PVL: Parameter Value Language
|
Mode set selector. More...
#include <Lister.hh>
Public Member Functions | |
bool | operator!= (const Which_Mode &which) const |
bool | operator== (const Which_Mode &which) const |
Public Attributes | |
char | state |
Mode set selector.
The Which_Mode class is provided to avoid type ambiguity if the arguments to the syntax methods where:
method (bool, bool = default)
is confused with
method (bool = default)
It is not sufficient to make the defaulted argument some other primitive type (e.g. an enum) since default conversions will still result in ambiguity.
The solution is this trivial class (struct) which contains a state data member and two methods for the == and != operators. Now the defaulted argument is typed to this class and no ambiguity occurs.
bool operator== | ( | const Which_Mode & | which | ) | const [inline] |
References Lister::Which_Mode::state.
bool operator!= | ( | const Which_Mode & | which | ) | const [inline] |
char state |
Referenced by Lister::Which_Mode::operator==().