class
#include <bn_any.h>
iany Base class of bn::
Can be used as a reference type for all bn::
Derived classes
-
template<int MaxSize, int MaxAlignment = alignof(int)>class any
std::any
like container with a fixed size buffer.
Constructors, destructors, conversion operators
- ~iany() noexcept
- Destructor.
- operator bool() const explicit
- Indicates if it contains a value or not.
Public functions
- auto operator=(const iany& other) -> iany&
- Copy assignment operator.
- auto operator=(iany&& other) -> iany& noexcept
- Move assignment operator.
-
template<typename Type>auto operator=(const Type& value) -> iany&
- Constructor.
-
template<typename Type>auto operator=(Type& value) -> iany&
- Constructor.
-
template<typename Type>auto operator=(Type&& value) -> iany& noexcept
- Constructor.
- auto has_value() const -> bool
- Indicates if it contains a value or not.
-
auto type() const -> type_
id_ t - Returns the type_
id_ t of the contained value if any, otherwise type_id_t(). - auto max_size() const -> int
- Returns the maximum size in bytes of the managed objects.
- auto max_alignment() const -> int
- Returns the maximum alignment in bytes of the managed objects.
-
template<typename Type>auto value() const -> const Type&
- Returns a const reference to the contained value.
-
template<typename Type>auto value() -> Type&
- Returns a reference to the contained value.
-
template<typename Type>auto value_or(const Type& default_value) const -> Type
- Returns a copy of the contained value if this iany has one; otherwise it returns a copy of the given default value.
-
template<typename Type>auto value_or(Type&& default_value) const -> Type
- Returns a copy of the contained value if this iany has one; otherwise it returns a moved copy of the given default value.
-
template<typename Type, typename... Args>auto emplace(Args && ... args) -> Type&
- Constructs the contained value in-place.
- void reset()
- Disposes the contained value.
- void swap(iany& other)
- Exchanges the contents of this iany with those of the other one.
Friends
Function documentation
template<typename Type>
const Type& bn:: iany:: value() const
Returns a const reference to the contained value.
Template parameters | |
---|---|
Type | Type of the contained value. |
template<typename Type>
Type& bn:: iany:: value()
Returns a reference to the contained value.
Template parameters | |
---|---|
Type | Type of the contained value. |
template<typename Type>
Type bn:: iany:: value_or(const Type& default_value) const
Returns a copy of the contained value if this iany has one; otherwise it returns a copy of the given default value.
Template parameters | |
---|---|
Type | Type of the contained value. |
template<typename Type>
Type bn:: iany:: value_or(Type&& default_value) const
Returns a copy of the contained value if this iany has one; otherwise it returns a moved copy of the given default value.
Template parameters | |
---|---|
Type | Type of the contained value. |
template<typename Type, typename... Args>
Type& bn:: iany:: emplace(Args && ... args)
Constructs the contained value in-place.
Template parameters | |
---|---|
Type | Type of the value to construct. |
Args | Types of the parameters of the value to construct. |
Parameters | |
args | Parameters of the value to construct. |
Returns | Reference to the constructed value. |