From 00cb0035c97b99119a8fbd6c16f7c7b3ecfba9f1 Mon Sep 17 00:00:00 2001 From: Phil nash Date: Fri, 26 Apr 2019 18:24:52 +0100 Subject: [PATCH] Enclosed generated StringMaker for enums in Catch namespace, rather than qualified --- include/internal/catch_tostring.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/internal/catch_tostring.h b/include/internal/catch_tostring.h index 402b6dbc..52634a8c 100644 --- a/include/internal/catch_tostring.h +++ b/include/internal/catch_tostring.h @@ -641,12 +641,14 @@ struct ratio_string { #endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER #define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \ - template<> struct Catch::StringMaker { \ +namespace Catch { \ + template<> struct StringMaker { \ static std::string convert( enumName value ) { \ static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \ return enumInfo.lookup( static_cast( value ) ); \ } \ - }; + }; \ +} #define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )