Make operator<< to return void
authorMarco Costalba <mcostalba@gmail.com>
Thu, 3 Apr 2014 08:34:25 +0000 (10:34 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 3 Apr 2014 08:34:25 +0000 (10:34 +0200)
This should help preventing misuse.

No functional change.

src/ucioption.cpp
src/ucioption.h

index dbab6fc..a229027 100644 (file)
@@ -139,13 +139,12 @@ Option::operator std::string() const {
 
 /// 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;
 }
 
 
index 75e4ac1..19ca14f 100644 (file)
@@ -47,7 +47,7 @@ public:
   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;