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__ )