An Any class represents a general type and is capable of storing any type.
More...
#include <mn_any.hpp>
An Any class represents a general type and is capable of storing any type.
- Note
- Code taken from https://github.com/martinmoene/any-lite. Original copyright by Martin Moene. Distributed under the Boost Software License, Version 1.0.
-
Modified for MiniThread
◆ holder_type
◆ self_type
◆ basic_any() [1/4]
constexpr mn::container::basic_any::basic_any |
( |
| ) |
|
|
inlineconstexprnoexcept |
◆ basic_any() [2/4]
template<class T >
mn::container::basic_any::basic_any |
( |
const T & |
other | ) |
|
|
inline |
Construct an any which stores the init parameter inside.
◆ basic_any() [3/4]
mn::container::basic_any::basic_any |
( |
const self_type & |
other | ) |
|
|
inline |
Copy constructor, works with both empty and initialized Any values.
◆ basic_any() [4/4]
mn::container::basic_any::basic_any |
( |
self_type && |
other | ) |
|
|
inlinenoexcept |
Copy constructor, works with both empty and initialized Any values.
◆ ~basic_any()
mn::container::basic_any::~basic_any |
( |
| ) |
|
|
inline |
◆ construct() [1/2]
void mn::container::basic_any::construct |
( |
const self_type & |
other | ) |
|
|
inlineprivate |
◆ construct() [2/2]
template<class T >
void mn::container::basic_any::construct |
( |
const T & |
other | ) |
|
|
inlineprivate |
Helper function to construct the basic_any from value.
◆ deconstruct()
void mn::container::basic_any::deconstruct |
( |
bool |
bdelete = false | ) |
|
|
inlineprivate |
Helper function to deconstruct.
- Parameters
-
bdelete | Then free the content. |
- Note
- only call with true in deconstructor.
◆ emplace()
template<class T , class... Args>
void mn::container::basic_any::emplace |
( |
Args &&... |
args | ) |
|
|
inline |
◆ has_value()
bool mn::container::basic_any::has_value |
( |
| ) |
const |
|
inlinenoexcept |
Has the basic_any any value?
- Returns
- True The basic_any is has any value and if false then not.
◆ is_empty()
bool mn::container::basic_any::is_empty |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator=() [1/3]
◆ operator=() [2/3]
template<typename T >
self_type& mn::container::basic_any::operator= |
( |
const T & |
other | ) |
|
|
inlinenoexcept |
Assignment operator for all types.
◆ operator=() [3/3]
◆ reset()
void mn::container::basic_any::reset |
( |
| ) |
|
|
inlinenoexcept |
◆ swap()
self_type& mn::container::basic_any::swap |
( |
any & |
other | ) |
|
|
inlinenoexcept |
Swaps the content of the two Anys.
◆ to_pointer() [1/2]
template<class T >
T* mn::container::basic_any::to_pointer |
( |
| ) |
|
|
inline |
Get the content as pointer.
- Returns
- The content as pointer.
◆ to_pointer() [2/2]
template<class T >
const T* mn::container::basic_any::to_pointer |
( |
| ) |
const |
|
inline |
Get the content as pointer.
- Returns
- The content as pointer.
◆ type()
const std::type_info& mn::container::basic_any::type |
( |
| ) |
const |
|
inlinenoexcept |
Returns the type information of the stored content.
- Returns
- the type information of the stored content or when empty then the typeid from void.
◆ m_asyContent
The documentation for this class was generated from the following file: