X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0a9b604048c4568bb2c2709f3b824da719a7e737..48d7293b28a54e1fb0bbeef9ed605bb8dfc4b513:/include/xbt/config.hpp?ds=sidebyside diff --git a/include/xbt/config.hpp b/include/xbt/config.hpp index b5b3e9d7e9..1758b74ed4 100644 --- a/include/xbt/config.hpp +++ b/include/xbt/config.hpp @@ -30,7 +30,7 @@ public: : std::runtime_error(what) {} explicit missing_key_error(const char* what) : std::runtime_error(what) {} - ~missing_key_error(); + ~missing_key_error() noexcept; }; template inline @@ -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; } }; }