Remove the relative comparison operators on LogLevel
authorChristopher Dykes <cdykes@fb.com>
Fri, 16 Jun 2017 08:12:53 +0000 (01:12 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 16 Jun 2017 08:24:17 +0000 (01:24 -0700)
Summary: MSVC, GCC, and Clang define the relative comparison operators by default on `enum class` values, however under MSVC defining them explicitly causes the compiler to fail to resolve which operator to use, so just remove them entirely, as they aren't needed.

Reviewed By: simpkins

Differential Revision: D5259835

fbshipit-source-id: 1b91db5de0fc47320daabfdd7132ae910887ff0f

folly/experimental/logging/LogLevel.h

index c5f1920321c68a05f363390f3573e875e0f67dc8..05c1603efcc72955134d0de177dd61d1161651e5 100644 (file)
@@ -98,22 +98,6 @@ inline LogLevel& operator-=(LogLevel& level, uint32_t value) {
   return level;
 }
 
   return level;
 }
 
-/*
- * Comparisons between LogLevel values
- */
-inline bool operator<=(LogLevel a, LogLevel b) {
-  return static_cast<uint32_t>(a) <= static_cast<uint32_t>(b);
-}
-inline bool operator<(LogLevel a, LogLevel b) {
-  return static_cast<uint32_t>(a) < static_cast<uint32_t>(b);
-}
-inline bool operator>=(LogLevel a, LogLevel b) {
-  return static_cast<uint32_t>(a) >= static_cast<uint32_t>(b);
-}
-inline bool operator>(LogLevel a, LogLevel b) {
-  return static_cast<uint32_t>(a) > static_cast<uint32_t>(b);
-}
-
 /**
  * Construct a LogLevel from a string name.
  */
 /**
  * Construct a LogLevel from a string name.
  */