From b297193296e6afd0a6045ab7cd9daf2374b3fb3a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 8 Dec 2018 18:09:58 +0100 Subject: Use constexpr if Change-Id: I7c34dfb5a83b14afc740772cffe407d4773b07e5 Reviewed-on: https://gerrit.libreoffice.org/64818 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/com/sun/star/uno/Sequence.hxx | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'include/com/sun/star') diff --git a/include/com/sun/star/uno/Sequence.hxx b/include/com/sun/star/uno/Sequence.hxx index 64f84ffc7bc3..33014a81a4fd 100644 --- a/include/com/sun/star/uno/Sequence.hxx +++ b/include/com/sun/star/uno/Sequence.hxx @@ -245,9 +245,6 @@ void sequence_output_bytes( std::basic_ostream &os, const value_t os.setf(flags); } -template -struct negation : std::integral_constant { }; - } /** @@ -257,21 +254,15 @@ struct negation : std::integral_constant { }; @since LibreOffice 6.1 */ template< typename value_t, typename charT, typename traits > -inline typename std::enable_if>::value, std::basic_ostream>::type &operator<<(std::basic_ostream &os, css::uno::Sequence < value_t > &v) +inline std::basic_ostream &operator<<(std::basic_ostream &os, css::uno::Sequence < value_t > &v) { const value_t *pAry = v.getConstArray(); sal_Int32 nLen = v.getLength(); - uno_detail::sequence_output_elems(os, pAry, nLen, std::is_integral()); - return os; -} - -template< typename value_t, typename charT, typename traits > -inline typename std::enable_if::value, std::basic_ostream>::type &operator<<(std::basic_ostream &os, css::uno::Sequence < value_t > &v) -{ - // specialisation for signed bytes - const sal_Int8 *pAry = v.getConstArray(); - sal_Int32 nLen = v.getLength(); - uno_detail::sequence_output_bytes(os, pAry, nLen); + if constexpr (std::is_same::value) { + uno_detail::sequence_output_bytes(os, pAry, nLen); + } else { + uno_detail::sequence_output_elems(os, pAry, nLen, std::is_integral()); + } return os; } -- cgit