StormByte C++ Library 0.0.9999
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
|
A class that can hold a value of any of the specified types. More...
#include <variadic_value.hxx>
Public Member Functions | |
VariadicValue ()=default | |
Default constructor. | |
template<typename T , typename = std::enable_if_t<(std::is_same_v<T, Types> || ...)>> | |
VariadicValue (T value) | |
Constructor with a value of one of the specified types. | |
~VariadicValue () noexcept=default | |
Destructor. | |
VariadicValue (const VariadicValue &other) | |
Copy constructor with deep copy for std::unique_ptr. | |
VariadicValue & | operator= (const VariadicValue &other) |
Copy assignment operator with deep copy for std::unique_ptr. | |
VariadicValue (VariadicValue &&) noexcept=default | |
Move constructor (default behavior). | |
VariadicValue & | operator= (VariadicValue &&) noexcept=default |
Move assignment operator (default behavior). | |
constexpr bool | operator== (const VariadicValue &other) const |
Equality operator. | |
constexpr bool | operator!= (const VariadicValue &other) const |
Inequality operator. | |
template<typename T > | |
T & | Get () |
Retrieves the stored value of the specified type. | |
template<typename T > | |
const T & | Get () const |
Retrieves the stored value of the specified type (const version). | |
A class that can hold a value of any of the specified types.
This class is a variant that can hold a value of any of the specified types. It is useful when you need to store a value that can be of different types.
Types | The types that the value can be of. |
|
inlineexplicit |
Constructor with a value of one of the specified types.
T | The type of the value to store. |
value | The value to store. |
|
inline |
Copy constructor with deep copy for std::unique_ptr.
other | The VariadicValue instance to copy from. |
|
defaultnoexcept |
Move constructor (default behavior).
other | The VariadicValue instance to move from. |
|
inline |
Retrieves the stored value of the specified type.
T | The type of the value to retrieve. |
ValueTypeMismatch | If the requested type does not match the stored type. |
|
inline |
Retrieves the stored value of the specified type (const version).
T | The type of the value to retrieve. |
ValueTypeMismatch | If the requested type does not match the stored type. |
|
inlineconstexpr |
Inequality operator.
other | The other VariadicValue instance to compare with. |
|
inline |
Copy assignment operator with deep copy for std::unique_ptr.
other | The VariadicValue instance to copy from. |
|
defaultnoexcept |
Move assignment operator (default behavior).
other | The VariadicValue instance to move from. |
|
inlineconstexpr |
Equality operator.
other | The other VariadicValue instance to compare with. |