From 8a111804b4541b15f26dec4d5ac06115f0fca53f Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 3 May 2016 12:08:50 +0200 Subject: [PATCH] [config] More general comparators for Flag Fix ambiguity in overload resolution --- include/xbt/config.hpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index 7b2d7a432b..1758b74ed4 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -220,14 +220,22 @@ public: operator T const&() const{ return value_; } // Basic interop with T: - Flag& operator=(T const& that) { value_ = that; return *this; } - Flag& operator=(T && that) { value_ = that; return *this; } - bool operator==(T const& that) const { return value_ == that; } - bool operator!=(T const& that) const { return value_ != that; } - bool operator<(T const& that) const { return value_ < that; } - bool operator>(T const& that) const { return value_ > that; } - bool operator<=(T const& that) const { return value_ <= that; } - bool operator>=(T const& that) const { return value_ >= that; } + template + Flag& operator=(U const& that) { value_ = that; return *this; } + template + Flag& operator=(U && that) { value_ = that; return *this; } + template + bool operator==(U const& that) const { return value_ == that; } + template + bool operator!=(U const& that) const { return value_ != that; } + template + bool operator<(U const& that) const { return value_ < that; } + template + bool operator>(U const& that) const { return value_ > that; } + template + bool operator<=(U const& that) const { return value_ <= that; } + template + bool operator>=(U const& that) const { return value_ >= that; } }; } -- 2.20.1