Value
-
struct Value
Represents a value that can be one of the following five types:
integer (
int64_t
).floating-point value (
double
).boolean (
bool
).string (
std::string
).empty
It is possible to convert a C++ value to a
Value
instance and back to a C++ value.Value
also overloads several operators such as addition and multiplication.Public Functions
-
integer_type to_integer() const
Convert this value to an integer. The data type of this value should be
integer
,double
, orboolean
.
-
std::string to_string() const
Convert this value to a string.
-
bool to_bool() const
Convert this value to a
bool
.
-
double to_double() const
Convert this value to a
double
.
-
float to_float() const
Convert this value to a
float
.
-
TemplateArg to_template_arg() const
Convert this value to a
TemplateArg
.
-
template<typename T>
inline bool is() const Returns
true
if this value is convertible to an instance ofT
.