54 explicit CmdOption(
const T& _val) : val_(_val), valid_(
true), enabled_(
false) { }
55 CmdOption() : val_(T()),valid_(
false), enabled_(
false) { }
58 bool is_valid(
void)
const {
return valid_; }
59 bool has_value(
void)
const {
return is_valid(); }
62 bool is_enabled()
const {
return enabled_; }
64 void enable() { enabled_ =
true; }
74 operator T ()
const {
return val_; }
77 operator T* ()
const {
return is_valid() ? &val_ :
nullptr; }
92template <
typename T >
Definition: CmdOption.hh:49
std::ostream & operator<<(std::ostream &_o, const Timer &_t)
Write seconds to output stream.
Definition: Timer.hh:199