92 const T &operator*()
const {
return value_; }
129 friend std::ostream &operator<<(std::ostream &os,
Type type) {
132 return os <<
"DEFAULT";
134 return os <<
"FROM_FILE";
136 return os <<
"FROM_COMMAND_LINE";
138 return os <<
"FROM_CODE";
Represents an optional value in dLinear.
@ FROM_FILE
Updated by a set-option/set-info in a file.
@ FROM_CODE
Explicitly updated from code.
@ FROM_COMMAND_LINE
Updated by a command-line argument.
void SetFromFile(const T &value)
Sets the value to value which is provided from a file.
Type type_
Type of the value.
OptionValue & operator=(T &&value)
Move-assign operator for T.
OptionValue(OptionValue &&) noexcept=default
Default move constructor.
T value_
Value the class holds.
const T & get() const
Get read-only access to the internal stored value of the optional value.
void SetFromCommandLine(const T &value)
Sets the value to value which is given by a command-line argument.
OptionValue(const OptionValue &)=default
Default copy constructor.
OptionValue(T value)
Constructs an option value with value.
Global namespace for the dlinear library.