The default action used for values.
More...
|
T | operator() (const std::string &, const std::string &value) const |
| The operator doing the conversion. More...
|
|
template<typename T>
struct gears::optparse::store< T >
The default action used for typed_value. It parses a single string argument to the appropriate type provided.
- Template Parameters
-
T | The type to convert the value to. |
Definition at line 68 of file actions.hpp.
The operator doing the conversion from string to the specified type. A specialisation is provided for bool
types that parses "1"
and "true"
as true
and "0"
and "false"
as false
.
- Exceptions
-
std::runtime_error | If boolean conversion failed. |
std::bad_cast | If other conversions failed. |
- Parameters
-
key | The key of the command line option. |
value | The value of the command line option. |
- Returns
- The equivalent of doing
gears::string::lexical_cast<T>(value)
.
Definition at line 82 of file actions.hpp.