mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-30 19:57:10 +01:00 
			
		
		
		
	Stop compilation if registering an enum could truncate its value
We probably want to use a bigger type (e.g. `int64_t`) later on, but the is a mess right now anyway.
This commit is contained in:
		| @@ -32,6 +32,7 @@ namespace Catch { | ||||
|  | ||||
|         template<typename E> | ||||
|         Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) { | ||||
|             static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int"); | ||||
|             std::vector<int> intValues; | ||||
|             intValues.reserve( values.size() ); | ||||
|             for( auto enumValue : values ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský