#include <any_of.hpp>
◆ deleter_type
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
using mlab::any_of< Enum, T, Default >::deleter_type = void (*)(void *) |
|
private |
Pointer to a ''void delete_this_pointer(void *)'' function.
◆ enum_type
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
◆ value_type
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
template<Enum E>
◆ any_of() [1/5]
template<class Enum , template< Enum > class T, Enum Default>
◆ any_of() [2/5]
template<class Enum , template< Enum > class T, Enum Default>
template<Enum E>
◆ any_of() [3/5]
template<class Enum , template< Enum > class T, Enum Default>
◆ any_of() [4/5]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
◆ ~any_of()
template<class Enum , template< Enum > class T, Enum Default>
◆ any_of() [5/5]
template<class Enum , template< Enum > class T, Enum Default>
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.
enum struct bar { a, b };
template <bar> struct foo {};
struct any_of_foo :
public any_of<bar, foo> {
any_of_foo(any_of_foo const &other) : any_of<bar, foo>{other.type()} {
switch (other.type()) {
case bar::a: set<bar::a>(other.get<bar::a>()); break;
case bar::b: set<bar::b>(other.get<bar::b>()); break;
}
}
}
any_of()
Definition any_of.hpp:189
◆ assert_holds_memory()
template<class Enum , template< Enum > class T, Enum Default>
void mlab::any_of< Enum, T, Default >::assert_holds_memory |
( |
| ) |
const |
|
private |
◆ assert_type_is()
template<class Enum , template< Enum > class T, Enum Default>
◆ default_deleter_fn()
template<class Enum , template< Enum > class T, Enum Default>
template<Enum E>
void mlab::any_of< Enum, T, Default >::default_deleter_fn |
( |
void * | ptr | ) |
|
|
staticprivate |
◆ free()
template<class Enum , template< Enum > class T, Enum Default>
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.
◆ get() [1/3]
template<class Enum , template< Enum > class T, Enum Default>
template<Enum E>
◆ get() [2/3]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
T< E > const & mlab::any_of< Enum, T, Default >::get |
( |
| ) |
const |
|
nodiscard |
◆ get() [3/3]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
template<Enum E>
T< E > const & mlab::any_of< Enum, T, Default >::get |
( |
| ) |
const |
◆ get_default_deleter()
template<class Enum , template< Enum > class T, Enum Default>
template<Enum E>
|
staticnodiscardconstexprprivate |
◆ holds_memory()
template<class Enum , template< Enum > class T, Enum Default>
bool mlab::any_of< Enum, T, Default >::holds_memory |
( |
| ) |
const |
|
nodiscardprivate |
True if there is any memory in the heap associated to this object.
◆ operator=() [1/4]
template<class Enum , template< Enum > class T, Enum Default>
◆ operator=() [2/4]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
◆ operator=() [3/4]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
◆ operator=() [4/4]
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
template<Enum E>
◆ set()
template<class Enum , template< Enum > class T, Enum Default>
template<Enum E, class U >
◆ type()
template<class Enum , template< Enum > class T, Enum Default>
◆ can_be_stored_in_place_v
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
bool mlab::any_of< Enum, T, Default >::can_be_stored_in_place_v |
|
staticconstexprprivate |
Initial value:=
sizeof(T<E>) <= sizeof(std::uintptr_t) and (alignof(std::uintptr_t) % alignof(T<E>)) == 0 and std::is_trivial_v<T<E>>
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.
◆ default_type
template<class Enum , template< Enum > class T, Enum Default = Enum{}>
The documentation for this class was generated from the following file: