Project Alice
Loading...
Searching...
No Matches
Cyto Namespace Reference

Classes

class  Any
 
struct  AnyActions
 
struct  AnyTraits
 
struct  fallback_typeinfo
 
struct  IsInPlaceType_
 
struct  IsInPlaceType_< std::in_place_index_t< S > >
 
struct  IsInPlaceType_< std::in_place_t >
 
struct  IsInPlaceType_< std::in_place_type_t< T > >
 
union  Storage
 

Typedefs

using StorageBuffer = std::aligned_storage_t< StorageBufferSize, std::alignment_of_v< void * > >
 
template<class T >
using IsStorageBufferSized_ = std::bool_constant< sizeof(T)<=sizeof(StorageBuffer) &&std::alignment_of_v< StorageBuffer > % std::alignment_of_v< T >==0 >
 
template<class V , class T = std::decay_t<V>>
using IsAnyConstructible_ = std::bool_constant<!std::is_same_v< T, Any > &&!IsInPlaceType< V > &&std::is_copy_constructible_v< T > >
 
template<class T , class U , class... Args>
using IsAnyInitializerListConstructible_ = std::bool_constant< std::is_constructible_v< T, std::initializer_list< U > &, Args... > &&std::is_copy_constructible_v< T > >
 

Functions

template<class T >
ANY_ALWAYS_INLINE constexpr void const * fallback_typeid ()
 
ANY_ALWAYS_INLINE void swap (Any &lhs, Any &rhs) noexcept
 
template<class T , class... Args>
ANY_ALWAYS_INLINE Any make_any (Args &&... args)
 
template<class T , class U , class... Args>
ANY_ALWAYS_INLINE Any make_any (std::initializer_list< U > il, Args &&... args)
 
template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
any_cast (Any const &a)
 
template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
any_cast (Any &a)
 
template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
any_cast (Any &&a)
 
template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>>
T const * any_cast (Any const *a) noexcept
 
template<class V >
std::remove_cv_t< std::remove_reference_t< V > > * any_cast (Any *a) noexcept
 

Variables

template<class T >
constexpr bool IsInPlaceType = IsInPlaceType_<T>::value
 
constexpr size_t StorageBufferSize = 8 * sizeof(void*)
 
template<class T >
constexpr bool IsStorageBufferSized = IsStorageBufferSized_<T>::value
 
template<class V >
constexpr bool IsAnyConstructible = IsAnyConstructible_<V>::value
 
template<class T , class U , class... Args>
constexpr bool IsAnyInitializerListConstructible = IsAnyInitializerListConstructible_<T, U, Args...>::value
 

Typedef Documentation

◆ IsAnyConstructible_

template<class V , class T = std::decay_t<V>>
using Cyto::IsAnyConstructible_ = typedef std::bool_constant<!std::is_same_v<T, Any> && !IsInPlaceType<V> && std::is_copy_constructible_v<T> >

Definition at line 301 of file cyto_any.hpp.

◆ IsAnyInitializerListConstructible_

template<class T , class U , class... Args>
using Cyto::IsAnyInitializerListConstructible_ = typedef std::bool_constant<std::is_constructible_v<T, std::initializer_list<U>&, Args...> && std::is_copy_constructible_v<T> >

Definition at line 307 of file cyto_any.hpp.

◆ IsStorageBufferSized_

template<class T >
using Cyto::IsStorageBufferSized_ = typedef std::bool_constant<sizeof(T) <= sizeof(StorageBuffer) && std::alignment_of_v<StorageBuffer> % std::alignment_of_v<T> == 0>

Definition at line 109 of file cyto_any.hpp.

◆ StorageBuffer

using Cyto::StorageBuffer = typedef std::aligned_storage_t<StorageBufferSize, std::alignment_of_v<void*> >

Definition at line 106 of file cyto_any.hpp.

Function Documentation

◆ any_cast() [1/5]

template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
V Cyto::any_cast ( Any &&  a)

Definition at line 485 of file cyto_any.hpp.

◆ any_cast() [2/5]

template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
V Cyto::any_cast ( Any a)

Definition at line 475 of file cyto_any.hpp.

◆ any_cast() [3/5]

template<class V >
std::remove_cv_t< std::remove_reference_t< V > > * Cyto::any_cast ( Any a)
noexcept

Definition at line 499 of file cyto_any.hpp.

◆ any_cast() [4/5]

template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>, std::enable_if_t< std::is_constructible< V, T const & >{}, int > = 0>
V Cyto::any_cast ( Any const &  a)

Definition at line 465 of file cyto_any.hpp.

◆ any_cast() [5/5]

template<class V , class T = std::remove_cv_t<std::remove_reference_t<V>>>
T const * Cyto::any_cast ( Any const *  a)
noexcept

Definition at line 494 of file cyto_any.hpp.

◆ fallback_typeid()

template<class T >
ANY_ALWAYS_INLINE constexpr void const * Cyto::fallback_typeid ( )
constexpr

Definition at line 135 of file cyto_any.hpp.

◆ make_any() [1/2]

template<class T , class... Args>
ANY_ALWAYS_INLINE Any Cyto::make_any ( Args &&...  args)

Definition at line 454 of file cyto_any.hpp.

◆ make_any() [2/2]

template<class T , class U , class... Args>
ANY_ALWAYS_INLINE Any Cyto::make_any ( std::initializer_list< U >  il,
Args &&...  args 
)

Definition at line 459 of file cyto_any.hpp.

◆ swap()

ANY_ALWAYS_INLINE void Cyto::swap ( Any lhs,
Any rhs 
)
noexcept

Definition at line 449 of file cyto_any.hpp.

Variable Documentation

◆ IsAnyConstructible

template<class V >
constexpr bool Cyto::IsAnyConstructible = IsAnyConstructible_<V>::value
constexpr

Definition at line 304 of file cyto_any.hpp.

◆ IsAnyInitializerListConstructible

template<class T , class U , class... Args>
constexpr bool Cyto::IsAnyInitializerListConstructible = IsAnyInitializerListConstructible_<T, U, Args...>::value
constexpr

Definition at line 311 of file cyto_any.hpp.

◆ IsInPlaceType

template<class T >
constexpr bool Cyto::IsInPlaceType = IsInPlaceType_<T>::value
constexpr

Definition at line 103 of file cyto_any.hpp.

◆ IsStorageBufferSized

template<class T >
constexpr bool Cyto::IsStorageBufferSized = IsStorageBufferSized_<T>::value
constexpr

Definition at line 113 of file cyto_any.hpp.

◆ StorageBufferSize

constexpr size_t Cyto::StorageBufferSize = 8 * sizeof(void*)
constexpr

Definition at line 105 of file cyto_any.hpp.