|
mitteLib
|
#include <any_of.hpp>
Public Types | |
| template<Enum E> | |
| using | value_type = T<E> |
| using | enum_type = Enum |
Public Member Functions | |
| any_of () | |
| template<enum_type E> | |
| any_of (T< E > obj) | |
| any_of (any_of &&other) noexcept | |
| any_of & | operator= (any_of &&other) noexcept |
| any_of (any_of const &)=delete | |
| any_of & | operator= (any_of const &)=delete |
| ~any_of () | |
| enum_type | type () const |
| template<enum_type E> | |
| T< E > const & | get () const |
| template<enum_type E> | |
| T< E > & | get () |
| template<enum_type E> | |
| any_of & | operator= (T< E > obj) |
| template<Enum E> | |
| T< E > const & | get () const |
| template<Enum E> | |
| any_of< Enum, T, Default > & | operator= (T< E > obj) |
Static Public Attributes | |
| static constexpr enum_type | default_type = Default |
Protected Member Functions | |
| any_of (enum_type e) | |
| template<enum_type E, class U> | |
| void | set (U &&obj) |
Private Types | |
| using | deleter_type = void (*)(void *) |
Private Member Functions | |
| bool | holds_memory () const |
| void | assert_type_is (enum_type e) const |
| void | assert_holds_memory () const |
| void | free () |
| void const * | storage_allocated () const |
| void *& | storage_allocated () |
| void const * | storage_in_place () const |
| void * | storage_in_place () |
Static Private Member Functions | |
| template<enum_type E> | |
| static void | default_deleter_fn (void *ptr) |
| template<enum_type E> | |
| static constexpr deleter_type | get_default_deleter () |
Private Attributes | |
| enum_type | _active |
| std::uintptr_t | _storage {} |
| deleter_type | _deleter {} |
Static Private Attributes | |
| template<enum_type E> | |
| static constexpr bool | can_be_stored_in_place_v |
|
private |
Pointer to a ''void delete_this_pointer(void *)'' function.
| using mlab::any_of< Enum, T, Default >::enum_type = Enum |
| using mlab::any_of< Enum, T, Default >::value_type = T<E> |
| mlab::any_of< Enum, T, Default >::any_of | ( | ) |
| mlab::any_of< Enum, T, Default >::any_of | ( | T< E > | obj | ) |
|
noexcept |
|
delete |
| mlab::any_of< Enum, T, Default >::~any_of | ( | ) |
|
explicitprotected |
Create uninitialized any_of with type set as e. No memory is allocated and in-place storages are zero-initialized. This is suitable to be called as a base constructor when the type is know only at runtime but assignment is just about to take place, e.g. for implementing copy constructors in subclasses.
|
private |
|
private |
|
staticprivate |
|
private |
Invokes once the deleter for the pointer storage, if necessary, thus releasing the memory. Afterwards the storage is set to a nullptr with no deleter.
|
nodiscard |
| T< E > const & mlab::any_of< Enum, T, Default >::get | ( | ) | const |
|
nodiscard |
|
staticnodiscardconstexprprivate |
|
nodiscardprivate |
True if there is any memory in the heap associated to this object.
|
noexcept |
|
delete |
| any_of< Enum, T, Default > & mlab::any_of< Enum, T, Default >::operator= | ( | T< E > | obj | ) |
| any_of & mlab::any_of< Enum, T, Default >::operator= | ( | T< E > | obj | ) |
|
protected |
|
nodiscard |
|
staticconstexprprivate |
We store ''T<E>'' within a ''std::uintptr_t'' if and only of it fits, it's trivial (we do not call constructors or destructors in such a case) and it has a less strict align requirement.
|
staticconstexpr |