Added a () operator overload to treat ConfigOptionSingle like functions and return their value (accessor)

This commit is contained in:
Joseph Lenox 2018-07-18 22:29:39 -05:00
parent 84826ae5ee
commit eab034434a

View File

@ -55,6 +55,7 @@ class ConfigOptionSingle : public ConfigOption {
T value; T value;
ConfigOptionSingle(T _value) : value(_value) {}; ConfigOptionSingle(T _value) : value(_value) {};
operator T() const { return this->value; }; operator T() const { return this->value; };
T operator()() const { return this->value; };
void set(const ConfigOption &option) { void set(const ConfigOption &option) {
const ConfigOptionSingle<T>* other = dynamic_cast< const ConfigOptionSingle<T>* >(&option); const ConfigOptionSingle<T>* other = dynamic_cast< const ConfigOptionSingle<T>* >(&option);