template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
class blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >
- Template Parameters
-
| ExtraInfo | Either void or a struct that contains data members for additional type information. The struct has to have a static ExtraInfo get<T>() method that initializes the struct based on a type. |
| InlineBufferCapacity | Size of the inline buffer. This allows types that are small enough to be stored directly inside the Any without an additional allocation. |
| Alignment | Required minimum alignment of the inline buffer. If this is smaller than the alignment requirement of a used type, a separate allocation is necessary. |
| ExtraData | Depending on the Alignment template parameter, there may be extra padding space that's available to store some data. This type is stored after the buffer to use that space. |
Definition at line 107 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
template<typename
T, typename... Args>
| blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::Any |
( |
std::in_place_type_t< T > | , |
|
|
Args &&... | args ) |
|
inlineexplicit |
Constructs a new Any that contains the given type T from #args. The #std::in_place_type_t is used to disambiguate this and the copy/move constructors.
Definition at line 204 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| void * blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::allocate |
( |
| ) |
|
|
inline |
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| void * blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::allocate_on_empty |
( |
| ) |
|
|
inline |
Like emplace_on_empty but does not actually construct the value. The caller is responsible for calling the constructor before the value is used.
Definition at line 316 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| const RealExtraInfo & blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::extra_info |
( |
| ) |
const |
|
inline |
Get extra information that has been stored for the contained type.
Definition at line 390 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| T & blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::get |
( |
| ) |
|
|
inline |
Get a reference to the stored value. This invokes undefined behavior when T does not have the correct type.
Definition at line 362 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| const T & blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::get |
( |
| ) |
const |
|
inline |
Get a reference to the stored value. This invokes undefined behavior when T does not have the correct type.
Definition at line 372 of file BLI_any.hh.
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| bool blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::is |
( |
| ) |
const |
|
inline |
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| void blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::reset |
( |
| ) |
|
|
inline |
template<typename ExtraInfo = void, size_t InlineBufferCapacity = 8, size_t Alignment = 8, typename ExtraData = blenlib_detail::EmptyType>
| bool blender::Any< ExtraInfo, InlineBufferCapacity, Alignment, ExtraData >::is_same_any_v = std::is_same_v<std::decay_t<T>, Any> |
|
staticconstexpr |
Checks if T is the same type as this Any, because in this case the behavior of e.g. the assignment operator is different.
Definition at line 149 of file BLI_any.hh.