#include <bn_any.h>
template<int MaxSize, int MaxAlignment = alignof(int)>
any class
std::any
like container with a fixed size buffer.
Template parameters | |
---|---|
MaxSize | Maximum size in bytes of the managed objects. |
MaxAlignment | Maximum alignment in bytes of the managed objects. |
It doesn't throw exceptions. Instead, asserts are used to ensure valid usage.
Base classes
Constructors, destructors, conversion operators
- any()
- Default constructor.
- any(const any& other)
- Copy constructor.
- any(any&& other) noexcept
- Move constructor.
- any(const iany& other)
- Copy constructor.
- any(iany&& other) noexcept
- Move constructor.
-
template<typename Type>any(const Type& value) explicit
- Constructor.
-
template<typename Type>any(Type& value) explicit
- Constructor.
-
template<typename Type>any(Type&& value) explicit
- Constructor.
Public functions
- auto operator=(const any& other) -> any&
- Copy assignment operator.
- auto operator=(any&& other) -> any& noexcept
- Move assignment operator.
- auto operator=(const iany& other) -> any&
- Copy assignment operator.
- auto operator=(iany&& other) -> any& noexcept
- Move assignment operator.
-
template<typename Type>auto operator=(const Type& value) -> any&
- Assignment operator.
-
template<typename Type>auto operator=(Type& value) -> any&
- Assignment operator.
-
template<typename Type>auto operator=(Type&& value) -> any&
- Assignment operator.
-
template<typename Type, typename... Args>auto emplace(Args && ... args) -> Type&
- Constructs the contained value in-place.
Function documentation
template<int MaxSize, int MaxAlignment>
template<typename Type>
bn:: any<MaxSize, MaxAlignment>:: any(const Type& value) explicit
Constructor.
Parameters | |
---|---|
value | Constant value to copy. |
template<int MaxSize, int MaxAlignment>
template<typename Type>
bn:: any<MaxSize, MaxAlignment>:: any(Type& value) explicit
Constructor.
Parameters | |
---|---|
value | Non constant value to copy. |
template<int MaxSize, int MaxAlignment>
template<typename Type>
bn:: any<MaxSize, MaxAlignment>:: any(Type&& value) explicit
Constructor.
Parameters | |
---|---|
value | Value to move. |
template<int MaxSize, int MaxAlignment>
template<typename Type, typename... Args>
Type& bn:: any<MaxSize, MaxAlignment>:: 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. |