![]() |
Spicy
|
#include <type_erase.h>
Public Member Functions | |
ErasedBase (const ErasedBase &other)=default | |
ErasedBase (ErasedBase &&other) noexcept=default | |
ErasedBase & | operator= (const ErasedBase &other)=default |
ErasedBase & | operator= (ErasedBase &&other) noexcept=default |
template<typename T , IF_DERIVED_FROM(T, Trait) > | |
ErasedBase (T t, ConceptArgs &&... args) | |
ErasedBase (IntrusivePtr< Concept > data) | |
ErasedBase & | operator= (IntrusivePtr< Concept > data) |
const std::type_info & | typeid_ () const |
std::string | typename_ () const |
template<typename T > | |
const T & | as () const |
template<typename T > | |
T & | as () |
template<typename T > | |
bool | isA () const |
template<typename T > | |
std::optional< T > | tryAs () const |
template<typename T > | |
optional_ref< const T > | tryReferenceAs () const |
auto & | data () const |
auto & | data () |
uintptr_t | identity () const |
Base class for the publicly visible, type-erased interface class.
|
inline |
Casts the contained object into a specified type. This will aborts execution if the cast is not possible.
|
inline |
Casts the contained object into a specified type. This will aborts execution if the cast is not possible.
|
inline |
For internal use.
|
inline |
For internal use.
|
inline |
For internal use.
|
inline |
Returns true if the contained object can be casted into a specified type.
|
inline |
Attempts to cast the contained object into a specified type.
|
inline |
Attempts to cast the contained object into a specified type.
|
inline |
Returns type information for the contained type. If multiple type-erased objects are nested, it will return the information for the inner-most type.
|
inline |
Returns C++ type name for the contained type. If multiple type-erased objects are nested, it will return the information for the inner-most type.