Blender
V3.3
|
#include <BLI_any.hh>
Public Member Functions | |
Any ()=default | |
Any (const Any &other) | |
Any (Any &&other) noexcept | |
template<typename T , typename... Args> | |
Any (std::in_place_type_t< T >, Args &&...args) | |
template<typename T , BLI_ENABLE_IF((!is_same_any_v< T >)) > | |
Any (T &&value) | |
~Any () | |
Any & | operator= (const Any &other) |
template<typename T > | |
Any & | operator= (T &&other) |
void | reset () |
operator bool () const | |
bool | has_value () const |
template<typename T , typename... Args> | |
std::decay_t< T > & | emplace (Args &&...args) |
template<typename T , typename... Args> | |
std::decay_t< T > & | emplace_on_empty (Args &&...args) |
template<typename T > | |
bool | is () const |
void * | get () |
const void * | get () const |
template<typename T > | |
std::decay_t< T > & | get () |
template<typename T > | |
const std::decay_t< T > & | get () const |
const RealExtraInfo & | extra_info () const |
Static Public Attributes | |
template<typename T > | |
static constexpr bool | is_allowed_v = std::is_copy_constructible_v<T> |
template<typename T > | |
static constexpr bool | is_inline_v |
template<typename T > | |
static constexpr bool | is_same_any_v = std::is_same_v<std::decay_t<T>, Any> |
Definition at line 96 of file BLI_any.hh.
|
default |
|
inline |
Definition at line 153 of file BLI_any.hh.
References blender::detail::AnyTypeInfo< ExtraInfo >::copy_construct.
|
inlinenoexcept |
Definition at line 169 of file BLI_any.hh.
References blender::detail::AnyTypeInfo< ExtraInfo >::move_construct.
|
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 185 of file BLI_any.hh.
|
inline |
Constructs a new Any that contains the given value.
Definition at line 194 of file BLI_any.hh.
|
inline |
Definition at line 198 of file BLI_any.hh.
References blender::detail::AnyTypeInfo< ExtraInfo >::destruct.
Referenced by blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::emplace(), and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::operator=().
|
inline |
Definition at line 254 of file BLI_any.hh.
References blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::Any(), and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::~Any().
|
inline |
Definition at line 261 of file BLI_any.hh.
References BLI_assert, and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::has_value().
|
inline |
Get extra information that has been stored for the contained type.
Definition at line 330 of file BLI_any.hh.
References BLI_assert, and blender::detail::AnyTypeInfo< ExtraInfo >::extra_info.
Referenced by blender::GVArrayCommon::impl_from_storage(), and blender::VArrayCommon< T >::impl_from_storage().
|
inline |
Get a pointer to the stored value.
Definition at line 288 of file BLI_any.hh.
References BLI_assert, and blender::detail::AnyTypeInfo< ExtraInfo >::get.
Referenced by blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::get(), blender::GVArrayCommon::impl_from_storage(), blender::VArrayCommon< T >::impl_from_storage(), and blender::tests::TEST().
|
inline |
Get a reference to the stored value. This invokes undefined behavior when T does not have the correct type.
Definition at line 311 of file BLI_any.hh.
References BLI_assert, and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::get().
|
inline |
Get a pointer to the stored value.
Definition at line 298 of file BLI_any.hh.
References BLI_assert, and blender::detail::AnyTypeInfo< ExtraInfo >::get.
|
inline |
Get a reference to the stored value. This invokes undefined behavior when T does not have the correct type.
Definition at line 321 of file BLI_any.hh.
References BLI_assert, and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::get().
|
inline |
Definition at line 249 of file BLI_any.hh.
Referenced by blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::emplace_on_empty(), blender::GVArrayCommon::impl_from_storage(), blender::VArrayCommon< T >::impl_from_storage(), and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::operator bool().
|
inline |
Return true when the value that is currently stored is a T.
Definition at line 282 of file BLI_any.hh.
|
inline |
Definition at line 244 of file BLI_any.hh.
References blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::has_value().
|
inline |
Definition at line 210 of file BLI_any.hh.
References blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::Any(), and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::~Any().
|
inline |
Assign any value to the Any.
Definition at line 221 of file BLI_any.hh.
References blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::Any(), and blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::~Any().
|
inline |
Destruct any existing value to make it empty.
Definition at line 234 of file BLI_any.hh.
References blender::detail::AnyTypeInfo< ExtraInfo >::destruct.
|
inlinestaticconstexpr |
Only copy constructible types can be stored in Any.
Definition at line 119 of file BLI_any.hh.
|
inlinestaticconstexpr |
Checks if the type will be stored in the inline buffer or if it requires a separate allocation.
Definition at line 126 of file BLI_any.hh.
|
inlinestaticconstexpr |
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 135 of file BLI_any.hh.