variant.h
Go to the documentation of this file.
73 using variant_policy_func = bool (*)(variant_policy_operation, const variant_data&, argument_wrapper);
976 detail::enable_if_t<!std::is_arithmetic<T>::value && !std::is_enum<T>::value, T> convert_impl(bool* ok = nullptr) const;
The argument class is used for forwarding arguments to properties or methods.
Definition argument.h:52
The array_range class provides a view into an underlying data structure with lower and upper limits.
Definition array_range.h:64
The instance class is used for forwarding the instance of an object to invoke a property or method.
Definition instance.h:48
The variant_associative_view describes a class that refers to an associative container (e....
Definition variant_associative_view.h:93
The variant_sequential_view describes a class that refers to an sequence container (e....
Definition variant_sequential_view.h:96
The variant class allows to store data of any type and convert between these types transparently.
Definition variant.h:199
bool operator>(const variant &other) const
Compares this variant with other and returns true if this is greater than other, otherwise returns fa...
bool is_associative_container() const
Returns true, when for the underlying or the wrapped type an associative_mapper exists.
variant_sequential_view create_sequential_view() const
Creates a variant_sequential_view from the containing value, when the type or its raw type or the wra...
bool operator<(const variant &other) const
Compares this variant with other and returns true if this is less than other, otherwise returns false...
int32_t to_int32(bool *ok=nullptr) const
Returns the containing variant as an int32_t when the type is an int32_t.
std::string to_string(bool *ok=nullptr) const
Returns the containing variant as a std::string when the type is a std::string.
double to_double(bool *ok=nullptr) const
Returns the containing variant as a double when the type is a double.
variant(const variant &other)
Constructs a new variant object from the given variant other.
bool operator==(const variant &other) const
Compares this variant with other and returns true if they are equal; otherwise returns false.
bool operator!=(const variant &other) const
Compares this variant with other and returns true if they are not equal; otherwise returns false.
bool convert(const type &target_type)
Converts the containing variant internally to the given type target_type.
float to_float(bool *ok=nullptr) const
Returns the containing variant as a float when the type is a float.
bool convert(T &value) const
Converts the containing data to the given value value and returns a bool flag that indicated whether ...
variant & operator=(T &&other)
Assigns the value of the other object to this variant.
const T & get_wrapped_value() const
Returns a reference to the contained wrapped value as type T.
variant & operator=(const variant &other)
Assigns the value of the other variant to this variant.
variant & operator=(variant &&other)
Assigns the value of the other variant to this variant.
variant_associative_view create_associative_view() const
Creates a variant_associative_view from the containing value, when the type or its raw type or the wr...
bool operator>=(const variant &other) const
Compares this variant with other and returns true if this is greater or equal then other,...
int64_t to_int64(bool *ok=nullptr) const
Returns the containing variant as an int64_t when the type is an int64_t.
bool is_type() const
Returns true if the containing variant data is of the given template type T.
void clear()
When the variant contains a value, then this function will clear the content.
uint64_t to_uint64(bool *ok=nullptr) const
Returns the containing variant as an uint64_t when the type is an uint64_t.
uint16_t to_uint16(bool *ok=nullptr) const
Returns the containing variant as an uint16_t when the type is an uint16_t.
uint32_t to_uint32(bool *ok=nullptr) const
Returns the containing variant as an uint32_t when the type is an uint32_t.
int8_t to_int8(bool *ok=nullptr) const
Returns the containing variant as an int8_t when the type is an int8_t.
int16_t to_int16(bool *ok=nullptr) const
Returns the containing variant as an int16_t when the type is an int16_t.
T convert(bool *ok=nullptr) const
Converts the containing data to a new value of type T and return this value.
uint8_t to_uint8(bool *ok=nullptr) const
Returns the containing variant as an uint8_t when the type is an uint8_t.
bool to_bool() const
Returns the variant as a bool if this variant is of type bool.
bool can_convert(const type &target_type) const
Returns true if the contained value can be converted to the given type target_type; otherwise false.
const T & get_value() const
Returns a reference to the containing value as type T.
bool can_convert() const
Returns true if the contained value can be converted to the given type T.
variant extract_wrapped_value() const
Extracts the wrapped value and copies its content into a new variant.
int to_int(bool *ok=nullptr) const
Returns the containing variant as an int when the type is an integer.
bool is_valid() const
Returns true if this variant is valid, that means the variant is holding some data.
bool is_sequential_container() const
Returns true, when for the underlying or the wrapped type an sequential_mapper exists.
bool operator<=(const variant &other) const
Compares this variant with other and returns true if this is less or equal than other,...
Definition access_levels.h:34
T variant_cast(const variant &operand)
Returns a reference to the containing value as type T.
detail::enum_data< Enum_Type > value(string_view, Enum_Type value)
The value function should be used to add a mapping from enum name to value during the registration pr...
Generated on Fri Jan 26 2024 00:00:00 for rttr - 0.9.7 by doxygen.