From c15b132f033881b7bc0e8c76698d928798dff921 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 3 Apr 2014 10:34:25 +0200 Subject: [PATCH] Make operator<< to return void This should help preventing misuse. No functional change. --- src/ucioption.cpp | 3 +-- src/ucioption.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ucioption.cpp b/src/ucioption.cpp index dbab6fc1..a2290279 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -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; } diff --git a/src/ucioption.h b/src/ucioption.h index 75e4ac13..19ca14fd 100644 --- a/src/ucioption.h +++ b/src/ucioption.h @@ -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; -- 2.39.2