NGen
Loading...
Searching...
No Matches
ngen::traits Namespace Reference

Classes

struct  bool_pack
 
struct  type_list
 

Typedefs

template<bool B>
using bool_constant = std::integral_constant<bool, B>
 
template<bool... Bs>
using conjunction = std::is_same<bool_pack<true, Bs...>, bool_pack<Bs..., true>>
 
template<bool... Bs>
using disjunction = bool_constant<!conjunction<!Bs...>::value>
 
template<typename T , typename... Ts>
using all_is_same = conjunction<std::is_same<Ts, T>::value...>
 Check that all types {Ts} are the same as {T}.
 
template<typename To , typename... From>
using all_is_convertible = conjunction<std::is_convertible<From, To>::value...>
 Checks that all types {From} are convertible to {T}.
 
template<typename From , typename... To>
using is_convertible_to_any = disjunction<std::is_convertible<From, To>::value...>
 Checks that {From} is convertible to any types in {To}.
 
template<typename T , typename... Ts>
using is_same_to_any = disjunction<std::is_same<T, Ts>::value...>
 Checks that {T} is the same as at least one of {Ts}.
 

Typedef Documentation

◆ all_is_convertible

template<typename To , typename... From>
using ngen::traits::all_is_convertible = conjunction<std::is_convertible<From, To>::value...>

Checks that all types {From} are convertible to {T}.

Template Parameters
ToType to constrain to
FromTypes to check

◆ all_is_same

template<typename T , typename... Ts>
using ngen::traits::all_is_same = conjunction<std::is_same<Ts, T>::value...>

Check that all types {Ts} are the same as {T}.

Template Parameters
TType to constrain to
TsTypes to check

◆ bool_constant

template<bool B>
using ngen::traits::bool_constant = std::integral_constant<bool, B>

◆ conjunction

template<bool... Bs>
using ngen::traits::conjunction = std::is_same<bool_pack<true, Bs...>, bool_pack<Bs..., true>>

◆ disjunction

template<bool... Bs>
using ngen::traits::disjunction = bool_constant<!conjunction<!Bs...>::value>

◆ is_convertible_to_any

template<typename From , typename... To>
using ngen::traits::is_convertible_to_any = disjunction<std::is_convertible<From, To>::value...>

Checks that {From} is convertible to any types in {To}.

Template Parameters
FromType to constrain to
ToTypes to check

◆ is_same_to_any

template<typename T , typename... Ts>
using ngen::traits::is_same_to_any = disjunction<std::is_same<T, Ts>::value...>

Checks that {T} is the same as at least one of {Ts}.

Template Parameters
TType to check
TsTypes to contrain to