All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
gears::optparse::store_const< T > Struct Template Reference

An action used to store constant values. More...

Public Member Functions

 store_const (T val)
 Constructs with the value provided.
 
operator() (const std::string &, const std::string &) const
 The operator doing the heavy lifting. More...
 

Detailed Description

template<typename T>
struct gears::optparse::store_const< T >

An action used to store constant values. The type provided must be copyable. When an option value is parsed, the value provided is always returned. Usually used in conjunction with the optparse::constant factory function.

Template Parameters
TThe type of contant to store.

Definition at line 112 of file actions.hpp.

Member Function Documentation

template<typename T >
T gears::optparse::store_const< T >::operator() ( const std::string &  ,
const std::string &   
) const
inline

The operator doing the heavy lifting. The value provided in the constructor is the one that is always returned regardless of the key or value matched.

Returns
The internal value held.

Definition at line 129 of file actions.hpp.