ValidKeyValuePairTrait< ILLEGALTYPES > Class Template Reference

#include <fid.h>

Detailed Description

template<typename... ILLEGALTYPES>
class maxon::ValidKeyValuePairTrait< ILLEGALTYPES >

Type trait to be used in identification of acceptable key-value type pairs.

Template Parameters
ILLEGALTYPESList of illegal types that the trait will search for.

Public Types

template<typename VALUETYPE , typename KEYTYPE >
using IsValid = typename std::conditional< IsValueTypeLegal< VALUETYPE, KEYTYPE >(), std::true_type, std::false_type >::type
 

Static Public Member Functions

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

Member Typedef Documentation

◆ IsValid

using IsValid = typename std::conditional<IsValueTypeLegal<VALUETYPE, KEYTYPE>(), std::true_type, std::false_type>::type

Use "ValidKeyValuePairTrait<ILLEGALTYPES...>::IsValid<VALUETYPE, KEYTYPE>" to get compile time validation of the type pair.

Member Function Documentation

◆ IsValueTypeLegal() [1/3]

static constexpr Bool IsValueTypeLegal ( const KEYTYPE &  key,
const VALUETYPE &   
)
staticconstexpr

Validation using deduced types, i.e. run type validation on lvalue, rvalue, ...

◆ IsValueTypeLegal() [2/3]

static constexpr Bool IsValueTypeLegal ( const KEYTYPE &  )
staticconstexpr

Validation using deduced key type. Allows validation directly using attribute FId variables.

◆ IsValueTypeLegal() [3/3]

static constexpr Bool IsValueTypeLegal ( )
staticconstexpr

Validation using explicit types.