Bifrost SDK
Bifrost SDK documentation
Amino::AnyPayloadTraits Class Reference

Traits about the to-be-payload of an Amino::Any. More...

#include <Any.h>

Public Types

template<typename ValueType , typename T = std::decay_t<ValueType>>
using is_cast_enabled = bool_t<(!std::is_same< Any, T >::value &&!is_amino_array< T >::value &&!std::is_same< Amino::StringView, T >::value &&!std::is_pointer< T >::value &&!std::is_array< ValueType >::value &&!std::is_array< std::remove_reference_t< ValueType > >::value)>
 Whether a Any can be queried to extract its payload as type T. More...
 
template<typename ValueType , typename T = std::decay_t<ValueType>>
using is_valid = bool_t<(is_cast_enabled< ValueType >::value &&std::is_copy_constructible< T >::value &&std::is_standard_layout< T >::value)>
 Whether a type T is a valid payload type. (i.e. can be assigned in an Any). More...
 
template<typename ValueType >
using enable_if_valid = std::enable_if_t< is_valid< ValueType >::value >
 Enable if the type is a valid payload type. More...
 
template<typename ValueType , typename... Args>
using enable_if_constructible = std::enable_if_t< std::is_constructible< std::decay_t< ValueType >, Args... >::value >
 Enable if the type can be constructed from the given arguments. More...
 

Detailed Description

Traits about the to-be-payload of an Amino::Any.

This is used to check that a given type T can be used as the payload type of an Amino::Any. If not, an error will be emitted at compile time.

Definition at line 37 of file Any.h.

Member Typedef Documentation

◆ enable_if_constructible

template<typename ValueType , typename... Args>
using Amino::AnyPayloadTraits::enable_if_constructible = std::enable_if_t< std::is_constructible<std::decay_t<ValueType>, Args...>::value>

Enable if the type can be constructed from the given arguments.

Definition at line 98 of file Any.h.

◆ enable_if_valid

template<typename ValueType >
using Amino::AnyPayloadTraits::enable_if_valid = std::enable_if_t<is_valid<ValueType>::value>

Enable if the type is a valid payload type.

Definition at line 94 of file Any.h.

◆ is_cast_enabled

template<typename ValueType , typename T = std::decay_t<ValueType>>
using Amino::AnyPayloadTraits::is_cast_enabled = bool_t<( !std::is_same<Any, T>::value && !is_amino_array<T>::value && !std::is_same<Amino::StringView, T>::value && !std::is_pointer<T>::value && !std::is_array<ValueType>::value && !std::is_array<std::remove_reference_t<ValueType> >::value)>

Whether a Any can be queried to extract its payload as type T.

Definition at line 58 of file Any.h.

◆ is_valid

template<typename ValueType , typename T = std::decay_t<ValueType>>
using Amino::AnyPayloadTraits::is_valid = bool_t<( is_cast_enabled<ValueType>::value && std::is_copy_constructible<T>::value && std::is_standard_layout<T>::value)>

Whether a type T is a valid payload type. (i.e. can be assigned in an Any).

Definition at line 81 of file Any.h.