forked from catchorg/Catch2
Fix MSVC deprecation warning for user-defined literals
Remove the space between "" and the suffix in user-defined literal operators (e.g. operator ""_a instead of operator "" _a) to avoid MSVC deprecation warning C5311.
This commit is contained in:
@@ -73,10 +73,10 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val) {
|
||||
Detail::Approx operator ""_a(long double val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
Detail::Approx operator "" _a(unsigned long long val) {
|
||||
Detail::Approx operator ""_a(unsigned long long val) {
|
||||
return Detail::Approx(val);
|
||||
}
|
||||
} // end namespace literals
|
||||
|
||||
@@ -118,8 +118,8 @@ namespace Detail {
|
||||
} // end namespace Detail
|
||||
|
||||
namespace literals {
|
||||
Detail::Approx operator "" _a(long double val);
|
||||
Detail::Approx operator "" _a(unsigned long long val);
|
||||
Detail::Approx operator ""_a(long double val);
|
||||
Detail::Approx operator ""_a(unsigned long long val);
|
||||
} // end namespace literals
|
||||
|
||||
template<>
|
||||
|
||||
@@ -92,12 +92,12 @@ namespace Catch {
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
|
||||
constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
return StringRef( rawChars, size );
|
||||
}
|
||||
} // namespace Catch
|
||||
|
||||
constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
|
||||
return Catch::StringRef( rawChars, size );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user