A SBO friendly, type-safe container for single values of any type.
More...
#include <entt.hpp>
|
|
| any () ENTT_NOEXCEPT |
| | Default constructor.
|
| |
| template<typename Type , typename... Args> |
| | any (std::in_place_type_t< Type >, [[maybe_unused]] Args &&... args) |
| | Constructs an any by directly initializing the new object. More...
|
| |
| template<typename Type > |
| | any (std::reference_wrapper< Type > value) ENTT_NOEXCEPT |
| | Constructs an any that holds an unmanaged object. More...
|
| |
| template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, any>>> |
| | any (Type &&value) |
| | Constructs an any from a given value. More...
|
| |
| | any (const any &other) |
| | Copy constructor. More...
|
| |
| | any (any &&other) ENTT_NOEXCEPT |
| | Move constructor. More...
|
| |
|
| ~any () |
| | Frees the internal storage, whatever it means.
|
| |
| any & | operator= (any other) |
| | Assignment operator. More...
|
| |
| type_info | type () const ENTT_NOEXCEPT |
| | Returns the type of the contained object. More...
|
| |
| const void * | data () const ENTT_NOEXCEPT |
| | Returns an opaque pointer to the contained instance. More...
|
| |
| void * | data () ENTT_NOEXCEPT |
| | Returns an opaque pointer to the contained instance. More...
|
| |
| template<typename Type , typename... Args> |
| void | emplace (Args &&... args) |
| | Replaces the contained object by creating a new instance directly. More...
|
| |
| | operator bool () const ENTT_NOEXCEPT |
| | Returns false if a wrapper is empty, true otherwise. More...
|
| |
| bool | operator== (const any &other) const ENTT_NOEXCEPT |
| | Checks if two wrappers differ in their content. More...
|
| |
A SBO friendly, type-safe container for single values of any type.
◆ any() [1/5]
template<typename Type , typename... Args>
| entt::any::any |
( |
std::in_place_type_t< Type > |
, |
|
|
[[maybe_unused] ] Args &&... |
args |
|
) |
| |
|
inlineexplicit |
Constructs an any 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. |
◆ any() [2/5]
template<typename Type >
| entt::any::any |
( |
std::reference_wrapper< Type > |
value | ) |
|
|
inline |
Constructs an any that holds an unmanaged object.
- 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. |
◆ any() [3/5]
template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, any>>>
| entt::any::any |
( |
Type && |
value | ) |
|
|
inline |
Constructs an any 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. |
◆ any() [4/5]
| entt::any::any |
( |
const any & |
other | ) |
|
|
inline |
Copy constructor.
- Parameters
-
| other | The instance to copy from. |
◆ any() [5/5]
| entt::any::any |
( |
any && |
other | ) |
|
|
inline |
Move constructor.
- Parameters
-
| other | The instance to move from. |
◆ data() [1/2]
| const void* entt::any::data |
( |
| ) |
const |
|
inline |
Returns an opaque pointer to the contained instance.
- Returns
- An opaque pointer the contained instance, if any.
◆ data() [2/2]
| void* entt::any::data |
( |
| ) |
|
|
inline |
Returns an opaque pointer to the contained instance.
- Returns
- An opaque pointer the contained instance, if any.
◆ emplace()
template<typename Type , typename... Args>
| void entt::any::emplace |
( |
Args &&... |
args | ) |
|
|
inline |
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. |
◆ operator bool()
| entt::any::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Returns false if a wrapper is empty, true otherwise.
- Returns
- False if the wrapper is empty, true otherwise.
◆ operator=()
| any& entt::any::operator= |
( |
any |
other | ) |
|
|
inline |
Assignment operator.
- Parameters
-
| other | The instance to assign from. |
- Returns
- This any object.
◆ operator==()
| bool entt::any::operator== |
( |
const any & |
other | ) |
const |
|
inline |
Checks if two wrappers differ in their content.
- Parameters
-
| other | Wrapper with which to compare. |
- Returns
- False if the two objects differ in their content, true otherwise.
◆ type()
Returns the type of the contained object.
- Returns
- The type of the contained object, if any.
◆ as_ref [1/2]
Aliasing constructor.
- Parameters
-
| other | A reference to an object that isn't necessarily initialized. |
- Returns
- An any that shares a reference to an unmanaged object.
◆ as_ref [2/2]
| any as_ref |
( |
const any & |
other | ) |
|
|
friend |
Aliasing constructor.
- Parameters
-
| other | A reference to an object that isn't necessarily initialized. |
- Returns
- An any that shares a reference to an unmanaged object.
◆ swap
| void swap |
( |
any & |
lhs, |
|
|
any & |
rhs |
|
) |
| |
|
friend |
Swaps two any objects.
- Parameters
-
| lhs | A valid any object. |
| rhs | A valid any object. |
The documentation for this class was generated from the following file: