This should help preventing misuse.
No functional change.
/// operator<<() inits options and assigns idx in the correct printing order
-Option& Option::operator<<(const Option& o) {
+void Option::operator<<(const Option& o) {
static size_t index = 0;
*this = o;
idx = index++;
- return *this;
}
Option(int v, int min, int max, OnChange = NULL);
Option& operator=(const std::string& v);
- Option& operator<<(const Option& o);
+ void operator<<(const Option& o);
operator int() const;
operator std::string() const;