diff --git a/src/catch2/catch_approx.h b/src/catch2/catch_approx.h index 8a53b0ef..e6a846b7 100644 --- a/src/catch2/catch_approx.h +++ b/src/catch2/catch_approx.h @@ -32,7 +32,7 @@ namespace Detail { Approx operator-() const; - template ::value>::type> + template ::value>> Approx operator()( T const& value ) { Approx approx( static_cast(value) ); approx.m_epsilon = m_epsilon; @@ -41,67 +41,67 @@ namespace Detail { return approx; } - template ::value>::type> + template ::value>> explicit Approx( T const& value ): Approx(static_cast(value)) {} - template ::value>::type> + template ::value>> friend bool operator == ( const T& lhs, Approx const& rhs ) { auto lhs_v = static_cast(lhs); return rhs.equalityComparisonImpl(lhs_v); } - template ::value>::type> + template ::value>> friend bool operator == ( Approx const& lhs, const T& rhs ) { return operator==( rhs, lhs ); } - template ::value>::type> + template ::value>> friend bool operator != ( T const& lhs, Approx const& rhs ) { return !operator==( lhs, rhs ); } - template ::value>::type> + template ::value>> friend bool operator != ( Approx const& lhs, T const& rhs ) { return !operator==( rhs, lhs ); } - template ::value>::type> + template ::value>> friend bool operator <= ( T const& lhs, Approx const& rhs ) { return static_cast(lhs) < rhs.m_value || lhs == rhs; } - template ::value>::type> + template ::value>> friend bool operator <= ( Approx const& lhs, T const& rhs ) { return lhs.m_value < static_cast(rhs) || lhs == rhs; } - template ::value>::type> + template ::value>> friend bool operator >= ( T const& lhs, Approx const& rhs ) { return static_cast(lhs) > rhs.m_value || lhs == rhs; } - template ::value>::type> + template ::value>> friend bool operator >= ( Approx const& lhs, T const& rhs ) { return lhs.m_value > static_cast(rhs) || lhs == rhs; } - template ::value>::type> + template ::value>> Approx& epsilon( T const& newEpsilon ) { double epsilonAsDouble = static_cast(newEpsilon); setEpsilon(epsilonAsDouble); return *this; } - template ::value>::type> + template ::value>> Approx& margin( T const& newMargin ) { double marginAsDouble = static_cast(newMargin); setMargin(marginAsDouble); return *this; } - template ::value>::type> + template ::value>> Approx& scale( T const& newScale ) { m_scale = static_cast(newScale); return *this; diff --git a/src/catch2/catch_generators.hpp b/src/catch2/catch_generators.hpp index 359db5f4..40edc9bb 100644 --- a/src/catch2/catch_generators.hpp +++ b/src/catch2/catch_generators.hpp @@ -149,7 +149,7 @@ namespace Generators { template - GeneratorWrapper> table( std::initializer_list::type...>> tuples ) { + GeneratorWrapper> table( std::initializer_list...>> tuples ) { return values>( tuples ); } diff --git a/src/catch2/catch_generators_specific.hpp b/src/catch2/catch_generators_specific.hpp index acca7d97..b4ca536c 100644 --- a/src/catch2/catch_generators_specific.hpp +++ b/src/catch2/catch_generators_specific.hpp @@ -64,8 +64,8 @@ public: // TODO: Ideally this would be also constrained against the various char types, // but I don't expect users to run into that in practice. template -typename std::enable_if::value && !std::is_same::value, -GeneratorWrapper>::type +std::enable_if_t::value && !std::is_same::value, +GeneratorWrapper> random(T a, T b) { return GeneratorWrapper( std::make_unique>(a, b) @@ -73,8 +73,8 @@ random(T a, T b) { } template -typename std::enable_if::value, -GeneratorWrapper>::type +std::enable_if_t::value, +GeneratorWrapper> random(T a, T b) { return GeneratorWrapper( std::make_unique>(a, b) diff --git a/src/catch2/catch_matchers_vector.h b/src/catch2/catch_matchers_vector.h index 13ac907d..f41e7fcc 100644 --- a/src/catch2/catch_matchers_vector.h +++ b/src/catch2/catch_matchers_vector.h @@ -107,17 +107,17 @@ namespace Matchers { std::string describe() const override { return "is approx: " + ::Catch::Detail::stringify( m_comparator ); } - template ::value>::type> + template ::value>> ApproxMatcher& epsilon( T const& newEpsilon ) { approx.epsilon(newEpsilon); return *this; } - template ::value>::type> + template ::value>> ApproxMatcher& margin( T const& newMargin ) { approx.margin(newMargin); return *this; } - template ::value>::type> + template ::value>> ApproxMatcher& scale( T const& newScale ) { approx.scale(newScale); return *this; diff --git a/src/catch2/catch_meta.hpp b/src/catch2/catch_meta.hpp index 4eca7efc..56cfa0a9 100644 --- a/src/catch2/catch_meta.hpp +++ b/src/catch2/catch_meta.hpp @@ -38,7 +38,7 @@ namespace Catch { using FunctionReturnType = std::remove_reference_t>>; #else template - using FunctionReturnType = typename std::remove_reference::type>::type>::type; + using FunctionReturnType = std::remove_reference_t>>; #endif } // namespace Catch diff --git a/src/catch2/catch_tostring.h b/src/catch2/catch_tostring.h index cba24628..57d43a6d 100644 --- a/src/catch2/catch_tostring.h +++ b/src/catch2/catch_tostring.h @@ -59,23 +59,23 @@ namespace Catch { std::string convertUnknownEnumToString( E e ); template - typename std::enable_if< + std::enable_if_t< !std::is_enum::value && !std::is_base_of::value, - std::string>::type convertUnstreamable( T const& ) { + std::string> convertUnstreamable( T const& ) { return Detail::unprintableString; } template - typename std::enable_if< + std::enable_if_t< !std::is_enum::value && std::is_base_of::value, - std::string>::type convertUnstreamable(T const& ex) { + std::string> convertUnstreamable(T const& ex) { return ex.what(); } template - typename std::enable_if< - std::is_enum::value - , std::string>::type convertUnstreamable( T const& value ) { + std::enable_if_t< + std::is_enum::value, + std::string> convertUnstreamable( T const& value ) { return convertUnknownEnumToString( value ); } @@ -99,7 +99,7 @@ namespace Catch { struct StringMaker { template static - typename std::enable_if<::Catch::Detail::IsStreamInsertable::value, std::string>::type + std::enable_if_t<::Catch::Detail::IsStreamInsertable::value, std::string> convert(const Fake& value) { ReusableStringStream rss; // NB: call using the function-like syntax to avoid ambiguity with @@ -110,7 +110,7 @@ namespace Catch { template static - typename std::enable_if::value, std::string>::type + std::enable_if_t::value, std::string> convert( const Fake& value ) { #if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER) return Detail::convertUnstreamable(value); @@ -126,12 +126,12 @@ namespace Catch { // Should be preferably called fully qualified, like ::Catch::Detail::stringify template std::string stringify(const T& e) { - return ::Catch::StringMaker::type>::type>::convert(e); + return ::Catch::StringMaker>>::convert(e); } template std::string convertUnknownEnumToString( E e ) { - return ::Catch::Detail::stringify(static_cast::type>(e)); + return ::Catch::Detail::stringify(static_cast>(e)); } #if defined(_MANAGED) @@ -515,7 +515,7 @@ namespace Catch { } template - struct StringMaker::value && !::Catch::Detail::IsStreamInsertable::value>::type> { + struct StringMaker::value && !::Catch::Detail::IsStreamInsertable::value>> { static std::string convert( R const& range ) { return rangeToString( range ); } diff --git a/src/catch2/catch_xmlwriter.cpp b/src/catch2/catch_xmlwriter.cpp index 3b96035b..a39d4a1b 100644 --- a/src/catch2/catch_xmlwriter.cpp +++ b/src/catch2/catch_xmlwriter.cpp @@ -53,26 +53,26 @@ namespace { } bool shouldNewline(XmlFormatting fmt) { - return !!(static_cast::type>(fmt & XmlFormatting::Newline)); + return !!(static_cast>(fmt & XmlFormatting::Newline)); } bool shouldIndent(XmlFormatting fmt) { - return !!(static_cast::type>(fmt & XmlFormatting::Indent)); + return !!(static_cast>(fmt & XmlFormatting::Indent)); } } // anonymous namespace XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) { return static_cast( - static_cast::type>(lhs) | - static_cast::type>(rhs) + static_cast>(lhs) | + static_cast>(rhs) ); } XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) { return static_cast( - static_cast::type>(lhs) & - static_cast::type>(rhs) + static_cast>(lhs) & + static_cast>(rhs) ); }