From fd0b01510ce8cd5f75c58ea60d5b81a477329d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 19 Jul 2012 23:32:46 +0200 Subject: [PATCH] Removed superfluous operators from Set class. Moreover returning base type from & operator is bad, really bad: if it results in 0, how it will map to original enum? --- src/Set.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/Set.h b/src/Set.h index 439e9a56c..5a9c04c67 100644 --- a/src/Set.h +++ b/src/Set.h @@ -54,33 +54,17 @@ template class Set { /** @brief Create set from one value */ inline constexpr Set(T value): value(static_cast(value)) {} - /** @brief Add value to the set */ - inline constexpr Set operator|(T other) const { - return Set(value | static_cast(other)); - } - /** @brief Union of two sets */ inline constexpr Set operator|(Set other) const { return Set(value | other.value); } - /** @brief Add value to the set and assign */ - inline Set& operator|=(T other) { - value |= static_cast(other); - return *this; - } - /** @brief Union two sets and assign */ inline Set& operator|=(Set other) { value |= other.value; return *this; } - /** @brief Check if given value is in the set */ - inline constexpr T operator&(T other) const { - return static_cast(value & static_cast(other)); - } - /** @brief Intersection of two sets */ inline constexpr Set operator&(Set other) const { return Set(value & other.value);