Drop <boost/operators.hpp> as a dependency of FBVector.h
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 2 Jan 2017 06:25:38 +0000 (22:25 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 2 Jan 2017 06:33:12 +0000 (22:33 -0800)
Summary:
[Folly] Drop `<boost/operators.hpp>` as a dependency of `FBVector.h`.

We can rough it.

Reviewed By: wqfish

Differential Revision: D4375986

fbshipit-source-id: 6b8c16ca9a55341fee396a253f7ad0c4d0201b0e

folly/FBVector.h

index 1bcc76513a793e42534756a176e9fe1784cfe16f..2be7d9ffefa5f074806d5e250753a6dbab630936 100644 (file)
@@ -41,8 +41,6 @@
 #include <folly/Traits.h>
 #include <folly/portability/BitsFunctexcept.h>
 
-#include <boost/operators.hpp>
-
 //=============================================================================
 // forward declaration
 
@@ -74,7 +72,7 @@ namespace folly {
 namespace folly {
 
 template <class T, class Allocator>
-class fbvector : private boost::totally_ordered<fbvector<T, Allocator>> {
+class fbvector {
 
   //===========================================================================
   //---------------------------------------------------------------------------
@@ -1502,18 +1500,34 @@ private:
 
   //===========================================================================
   //---------------------------------------------------------------------------
-  // lexicographical functions (others from boost::totally_ordered superclass)
+  // lexicographical functions
 public:
 
   bool operator==(const fbvector& other) const {
     return size() == other.size() && std::equal(begin(), end(), other.begin());
   }
 
+  bool operator!=(const fbvector& other) const {
+    return !(*this == other);
+  }
+
   bool operator<(const fbvector& other) const {
     return std::lexicographical_compare(
       begin(), end(), other.begin(), other.end());
   }
 
+  bool operator>(const fbvector& other) const {
+    return other < *this;
+  }
+
+  bool operator<=(const fbvector& other) const {
+    return !(*this > other);
+  }
+
+  bool operator>=(const fbvector& other) const {
+    return !(*this < other);
+  }
+
   //===========================================================================
   //---------------------------------------------------------------------------
   // friends