mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-23 05:46:11 +01:00
Enclosed generated StringMaker for enums in Catch namespace, rather than qualified
This commit is contained in:
parent
6267b06089
commit
00cb0035c9
@ -641,12 +641,14 @@ struct ratio_string<std::milli> {
|
|||||||
#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
|
#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
|
||||||
|
|
||||||
#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
|
#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
|
||||||
template<> struct Catch::StringMaker<enumName> { \
|
namespace Catch { \
|
||||||
|
template<> struct StringMaker<enumName> { \
|
||||||
static std::string convert( enumName value ) { \
|
static std::string convert( enumName value ) { \
|
||||||
static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
|
static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
|
||||||
return enumInfo.lookup( static_cast<int>( value ) ); \
|
return enumInfo.lookup( static_cast<int>( value ) ); \
|
||||||
} \
|
} \
|
||||||
};
|
}; \
|
||||||
|
}
|
||||||
|
|
||||||
#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
|
#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user