diff --git a/conversion/stringbuilder.h b/conversion/stringbuilder.h index 6707be8..e8ab834 100644 --- a/conversion/stringbuilder.h +++ b/conversion/stringbuilder.h @@ -12,23 +12,23 @@ namespace ConversionUtilities { /// \cond namespace Helper { -template >* = nullptr> std::size_t computeTupleElementSize(const StringType *str) +template > * = nullptr> std::size_t computeTupleElementSize(const StringType *str) { return str->size(); } -template >* = nullptr> std::size_t computeTupleElementSize(const StringType &str) +template > * = nullptr> std::size_t computeTupleElementSize(const StringType &str) { return str.size(); } -template >* = nullptr> +template > * = nullptr> std::size_t computeTupleElementSize(const CharType *str) { return std::char_traits::length(str); } -template >* = nullptr> +template > * = nullptr> constexpr std::size_t computeTupleElementSize(CharType) { return 1; @@ -36,7 +36,7 @@ constexpr std::size_t computeTupleElementSize(CharType) template >, std::is_integral, - std::is_unsigned>* = nullptr> + std::is_unsigned> * = nullptr> std::size_t computeTupleElementSize(IntegralType number, typename StringType::value_type base = 10) { std::size_t size = 0; @@ -47,7 +47,7 @@ std::size_t computeTupleElementSize(IntegralType number, typename StringType::va template >, std::is_integral, - std::is_signed>* = nullptr> + std::is_signed> * = nullptr> std::size_t computeTupleElementSize(IntegralType number, typename StringType::value_type base = 10) { std::size_t size = number < 0 ? 1 : 0; @@ -56,23 +56,23 @@ std::size_t computeTupleElementSize(IntegralType number, typename StringType::va return size; } -template >* = nullptr> void append(StringType &target, const StringType *str) +template > * = nullptr> void append(StringType &target, const StringType *str) { target.append(*str); } -template >* = nullptr> void append(StringType &target, const StringType &str) +template > * = nullptr> void append(StringType &target, const StringType &str) { target.append(str); } -template >* = nullptr> +template > * = nullptr> void append(StringType &target, const CharType *str) { target.append(str); } -template >* = nullptr> +template > * = nullptr> void append(StringType &target, CharType c) { target += c; @@ -80,7 +80,7 @@ void append(StringType &target, CharType c) template >, std::is_integral, - std::is_unsigned>* = nullptr> + std::is_unsigned> * = nullptr> void append(StringType &target, IntegralType number, typename StringType::value_type base = 10) { const auto start = target.begin() + target.size(); @@ -92,7 +92,7 @@ void append(StringType &target, IntegralType number, typename StringType::value_ template >, std::is_integral, - std::is_signed>* = nullptr> + std::is_signed> * = nullptr> void append(StringType &target, IntegralType number, typename StringType::value_type base = 10) { if (number < 0) { @@ -168,7 +168,7 @@ template constexpr auto operator%(const Tuple &lhs, const char *rh /*! * \brief Allows construction of string-tuples via %-operator, eg. string1 % "string2" % string3. */ -template >* = nullptr> +template > * = nullptr> constexpr auto operator%(const Tuple &lhs, IntegralType rhs) -> decltype(std::tuple_cat(lhs, std::make_tuple(rhs))) { return std::tuple_cat(lhs, std::make_tuple(rhs)); @@ -223,7 +223,7 @@ constexpr auto operator%(char lhs, const std::string &rhs) -> decltype(std::make * printVelocity("velocity: " % numberToString(velocityExample) % " km/h (" % numberToString(velocityExample / 3.6) + " m/s)")); * ``` */ -template >* = nullptr> +template > * = nullptr> inline std::string operator+(const Tuple &lhs, const std::string &rhs) { return tupleToString(std::tuple_cat(lhs, std::make_tuple(&rhs))); @@ -238,7 +238,7 @@ inline std::string operator+(const Tuple &lhs, const std::string &rhs) * printVelocity("velocity: " % numberToString(velocityExample) % " km/h (" % numberToString(velocityExample / 3.6) + " m/s)")); * ``` */ -template >* = nullptr> +template > * = nullptr> inline std::string operator+(const Tuple &lhs, const char *rhs) { return tupleToString(std::tuple_cat(lhs, std::make_tuple(rhs))); @@ -253,7 +253,8 @@ inline std::string operator+(const Tuple &lhs, const char *rhs) * printVelocity("velocity: " % numberToString(velocityExample) % " km/h (" % numberToString(velocityExample / 3.6) + " m/s)")); * ``` */ -template , std::is_integral>* = nullptr> +template , std::is_integral> * = nullptr> inline std::string operator+(const Tuple &lhs, IntegralType rhs) { return tupleToString(std::tuple_cat(lhs, std::make_tuple(rhs))); diff --git a/conversion/stringconversion.h b/conversion/stringconversion.h index 83e813a..5cb0122 100644 --- a/conversion/stringconversion.h +++ b/conversion/stringconversion.h @@ -287,7 +287,7 @@ template constexpr CharType digitToChar(CharType digit) * \sa stringToNumber() */ template , std::is_unsigned>* = nullptr> + Traits::EnableIf, std::is_unsigned> * = nullptr> StringType numberToString(IntegralType number, typename StringType::value_type base = 10) { std::size_t resSize = 0; @@ -308,7 +308,8 @@ StringType numberToString(IntegralType number, typename StringType::value_type b * \tparam StringType The string type (should be an instantiation of the basic_string class template). * \sa stringToNumber() */ -template , std::is_signed>* = nullptr> +template , std::is_signed> * = nullptr> StringType numberToString(IntegralType number, typename StringType::value_type base = 10) { const bool negative = number < 0; @@ -340,7 +341,7 @@ StringType numberToString(IntegralType number, typename StringType::value_type b * \a base and types). * \sa stringToNumber(), bufferToNumber() */ -template >* = nullptr> +template > * = nullptr> StringType numberToString(FloatingType number, typename StringType::value_type base = 10) { std::basic_stringstream ss; @@ -377,7 +378,7 @@ template CharType charToDigit(CharType character, CharType b * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), bufferToNumber() */ -template , std::is_unsigned>* = nullptr> +template , std::is_unsigned> * = nullptr> IntegralType stringToNumber(const StringType &string, typename StringType::value_type base = 10) { IntegralType result = 0; @@ -398,7 +399,7 @@ IntegralType stringToNumber(const StringType &string, typename StringType::value * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), bufferToNumber() */ -template , std::is_signed>* = nullptr> +template , std::is_signed> * = nullptr> IntegralType stringToNumber(const StringType &string, typename StringType::value_type base = 10) { auto i = string.begin(); @@ -432,7 +433,7 @@ IntegralType stringToNumber(const StringType &string, typename StringType::value * \a base and types). * \sa numberToString(), bufferToNumber() */ -template >* = nullptr> +template > * = nullptr> FloatingType stringToNumber(const StringType &string, typename StringType::value_type base = 10) { std::basic_stringstream ss; @@ -452,7 +453,7 @@ FloatingType stringToNumber(const StringType &string, typename StringType::value * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), bufferToNumber() */ -template , std::is_unsigned>* = nullptr> +template , std::is_unsigned> * = nullptr> IntegralType stringToNumber(const CharType *string, unsigned char base = 10) { IntegralType result = 0; @@ -473,7 +474,7 @@ IntegralType stringToNumber(const CharType *string, unsigned char base = 10) * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), stringToNumber() */ -template , std::is_unsigned>* = nullptr> +template , std::is_unsigned> * = nullptr> IntegralType bufferToNumber(const CharType *string, std::size_t size, unsigned char base = 10) { IntegralType result = 0; @@ -494,7 +495,7 @@ IntegralType bufferToNumber(const CharType *string, std::size_t size, unsigned c * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), bufferToNumber() */ -template , std::is_signed>* = nullptr> +template , std::is_signed> * = nullptr> IntegralType stringToNumber(const CharType *string, unsigned char base = 10) { if (!*string) { @@ -527,7 +528,7 @@ IntegralType stringToNumber(const CharType *string, unsigned char base = 10) * \throws A ConversionException will be thrown if the provided \a string is not a valid number. * \sa numberToString(), stringToNumber() */ -template , std::is_signed>* = nullptr> +template , std::is_signed> * = nullptr> IntegralType bufferToNumber(const CharType *string, std::size_t size, unsigned char base = 10) { if (!size) { diff --git a/io/ansiescapecodes.h b/io/ansiescapecodes.h index 52e6469..a6f4d55 100644 --- a/io/ansiescapecodes.h +++ b/io/ansiescapecodes.h @@ -120,7 +120,7 @@ constexpr auto color(Color foreground, ColorContext context, TextAttribute displ template >, - std::is_same>>* = nullptr> + std::is_same>> * = nullptr> inline std::ostream &operator<<(std::ostream &stream, TupleType displayAttribute) { setStyle(stream, std::get<0>(displayAttribute), std::get<1>(displayAttribute), std::get<2>(displayAttribute)); diff --git a/tests/testutils.h b/tests/testutils.h index 9cedfb9..ca5cabc 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -192,7 +192,7 @@ template AsHexNumber asHexNumber(const T &value) /*! * \brief Allows printing pairs so key/values of maps/hashes can be asserted using CPPUNIT_ASSERT_EQUAL. */ -template >* = nullptr> +template > * = nullptr> inline std::ostream &operator<<(std::ostream &out, const Pair &pair) { return out << "key: " << pair.first << "; value: " << pair.second << '\n'; @@ -201,7 +201,7 @@ inline std::ostream &operator<<(std::ostream &out, const Pair &pair) /*! * \brief Allows printing iteratable objects so those can be asserted using CPPUNIT_ASSERT_EQUAL. */ -template , Traits::Not>>* = nullptr> +template , Traits::Not>> * = nullptr> inline std::ostream &operator<<(std::ostream &out, const Iteratable &iteratable) { out << '\n';