|
constexpr | basic_any () noexcept |
| Default constructor.
|
|
template<typename Type, typename... Args> |
| basic_any (std::in_place_type_t< Type >, Args &&...args) |
| Constructs a wrapper by directly initializing the new object.
|
|
template<typename Type> |
| basic_any (std::in_place_t, Type *value) |
| Constructs a wrapper taking ownership of the passed object.
|
|
template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>>> |
| basic_any (Type &&value) |
| Constructs a wrapper from a given value.
|
|
| basic_any (const basic_any &other) |
| Copy constructor.
|
|
| basic_any (basic_any &&other) noexcept |
| Move constructor.
|
|
| ~basic_any () |
| Frees the internal storage, whatever it means.
|
|
basic_any & | operator= (const basic_any &other) |
| Copy assignment operator.
|
|
basic_any & | operator= (basic_any &&other) noexcept |
| Move assignment operator.
|
|
template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>>> |
basic_any & | operator= (Type &&value) |
| Value assignment operator.
|
|
const type_info & | type () const noexcept |
| Returns the object type if any, type_id<void>() otherwise.
|
|
const void * | data () const noexcept |
| Returns an opaque pointer to the contained instance.
|
|
const void * | data (const type_info &req) const noexcept |
| Returns an opaque pointer to the contained instance.
|
|
void * | data () noexcept |
| Returns an opaque pointer to the contained instance.
|
|
void * | data (const type_info &req) noexcept |
| Returns an opaque pointer to the contained instance.
|
|
template<typename Type, typename... Args> |
void | emplace (Args &&...args) |
| Replaces the contained object by creating a new instance directly.
|
|
bool | assign (const basic_any &other) |
| Assigns a value to the contained object without replacing it.
|
|
bool | assign (basic_any &&other) |
| Assigns a value to the contained object without replacing it.
|
|
void | reset () |
| Destroys contained object.
|
|
| operator bool () const noexcept |
| Returns false if a wrapper is empty, true otherwise.
|
|
bool | operator== (const basic_any &other) const noexcept |
| Checks if two wrappers differ in their content.
|
|
bool | operator!= (const basic_any &other) const noexcept |
| Checks if two wrappers differ in their content.
|
|
basic_any | as_ref () noexcept |
| Aliasing constructor.
|
|
basic_any | as_ref () const noexcept |
| Aliasing constructor.
|
|
bool | owner () const noexcept |
| Returns true if a wrapper owns its object, false otherwise.
|
|
any_policy | policy () const noexcept |
| Returns the current mode of an any object.
|
|
template<std::size_t Len, std::size_t Align>
class entt::basic_any< Len, Align >
A SBO friendly, type-safe container for single values of any type.
- Template Parameters
-
Len | Size of the storage reserved for the small buffer optimization. |
Align | Optional alignment requirement. |
Definition at line 38 of file any.hpp.
template<std::size_t Len, std::size_t Align>
template<typename Type, typename... Args>
entt::basic_any< Len, Align >::basic_any |
( |
std::in_place_type_t< Type > | , |
|
|
Args &&... | args ) |
|
inlineexplicit |
Constructs a wrapper by directly initializing the new object.
- Template Parameters
-
Type | Type of object to use to initialize the wrapper. |
Args | Types of arguments to use to construct the new instance. |
- Parameters
-
args | Parameters to use to construct the instance. |
Definition at line 175 of file any.hpp.
template<std::size_t Len, std::size_t Align>
template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>>>
Constructs a wrapper from a given value.
- Template Parameters
-
Type | Type of object to use to initialize the wrapper. |
- Parameters
-
value | An instance of an object to use to initialize the wrapper. |
Definition at line 202 of file any.hpp.
template<std::size_t Len, std::size_t Align>
template<typename Type, typename... Args>
Replaces the contained object by creating a new instance directly.
- Template Parameters
-
Type | Type of object to use to initialize the wrapper. |
Args | Types of arguments to use to construct the new instance. |
- Parameters
-
args | Parameters to use to construct the instance. |
Definition at line 342 of file any.hpp.
template<std::size_t Len, std::size_t Align>
template<typename Type, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Type>, basic_any>>>
Value assignment operator.
- Template Parameters
-
Type | Type of object to use to initialize the wrapper. |
- Parameters
-
value | An instance of an object to use to initialize the wrapper. |
- Returns
- This any object.
Definition at line 288 of file any.hpp.