ValidKeyValuePairTraitHelper< ILLEGALTYPE, OTHERILLEGALTYPES > Class Template Reference

#include <fid.h>

Detailed Description

template<typename ILLEGALTYPE, typename... OTHERILLEGALTYPES>
class maxon::details::ValidKeyValuePairTraitHelper< ILLEGALTYPE, OTHERILLEGALTYPES >

Value type validation class to that can be used to prevent certain types from being used as value type in containers. For instance, DataDictionary uses it to prevent use of LiteralId as value type (LiteralId is constexpr, cannot be de-serialized).

Template Parameters
ILLEGALTYPEFirst illegal type to test.
OTHERILLEGALTYPESMore illegal types. Optional.

Static Public Member Functions

template<typename VALUETYPE , typename KEYTYPE >
static constexpr Bool IsValueTypeLegal ()
 

Member Function Documentation

◆ IsValueTypeLegal()

static constexpr Bool IsValueTypeLegal ( )
staticconstexpr

Verifies if the final value type is legal. Final value type can either be VALUETYPE or KEYTYPE::ValueType in case of a MAXON_ATTRIBUTE.

Template Parameters
VALUETYPEValue type to be written to container.
KEYTYPEKey type used to write the value to the container.
Returns
True if the value is legal for all given illegal types.