Class ArgValue

Class Documentation

class ArgValue

Represents a single value of arbitrary type.

The value is internally represented as a std::string that is parsed when requested as a specific type

Public Functions

ArgValue() = default

Default construction results in empty value.

Note

the SFINAE parameter is used to work around an issue with libc++

ArgValue(const ArgValue&) = default

Copy constructor.

ArgValue(ArgValue&&) = default

Move constructor.

template<typename T>
inline ArgValue(T &&val, std::enable_if_t<notArgValue<T>, int> = 0)

Construct from any value.

template<typename T>
inline ArgValue &operator=(T &&val)

Assign any value.

inline bool empty() const

Check if no value is contained.

inline const std::string &get() const

Get string representation.

inline const std::string &operator()() const

Get string representation.

template<typename T>
inline T as() const

Get value of specific expected type.