Very basic type safe variant.
More...
#include <BackendOptions.hpp>
Very basic type safe variant.
Definition at line 36 of file BackendOptions.hpp.
◆ Var() [1/8]
Constructors.
Definition at line 41 of file BackendOptions.hpp.
41 : m_Vals(i), m_Type(VarTypes::Integer) {};
◆ Var() [2/8]
Definition at line 42 of file BackendOptions.hpp.
42 : m_Vals(u), m_Type(VarTypes::UnsignedInteger) {};
◆ Var() [3/8]
◆ Var() [4/8]
◆ Var() [5/8]
◆ Var() [6/8]
◆ Var() [7/8]
Disallow implicit conversions from types not explicitly allowed below.
Definition at line 50 of file BackendOptions.hpp.
52 static_assert(CheckAllowed<DisallowedType>::value,
"Type is not allowed for Var<DisallowedType>.");
53 assert(
false &&
"Unreachable code");
◆ Var() [8/8]
Copy Construct.
Definition at line 57 of file BackendOptions.hpp.
58 : m_Type(other.m_Type)
62 case VarTypes::String:
64 new (&m_Vals.s) std::string(other.m_Vals.s);
69 DoOp(other, [](
auto& a,
auto& b)
◆ ~Var()
◆ AsBool()
◆ AsFloat()
◆ AsInt()
◆ AsString()
std::string AsString |
( |
| ) |
const |
|
inline |
◆ AsUnsignedInt()
unsigned int AsUnsignedInt |
( |
| ) |
const |
|
inline |
◆ IsBool()
◆ IsFloat()
◆ IsInt()
◆ IsString()
◆ IsUnsignedInt()
bool IsUnsignedInt |
( |
| ) |
const |
|
inline |
◆ operator=()
Var& operator= |
( |
const Var & |
other | ) |
|
|
inline |
Copy operator.
Definition at line 79 of file BackendOptions.hpp.
82 if (m_Type == VarTypes::String)
87 m_Type = other.m_Type;
90 case VarTypes::String:
93 new (&m_Vals.s) std::string(other.m_Vals.s);
98 DoOp(other, [](
auto& a,
auto& b)
The documentation for this class was generated from the following file: