From 9c20a858e4faf2cd0e4d2661fa652febfd4ac5a8 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Sun, 1 Jan 2017 22:25:38 -0800 Subject: [PATCH] Drop as a dependency of FBVector.h Summary: [Folly] Drop `` as a dependency of `FBVector.h`. We can rough it. Reviewed By: wqfish Differential Revision: D4375986 fbshipit-source-id: 6b8c16ca9a55341fee396a253f7ad0c4d0201b0e --- folly/FBVector.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/folly/FBVector.h b/folly/FBVector.h index 1bcc7651..2be7d9ff 100644 --- a/folly/FBVector.h +++ b/folly/FBVector.h @@ -41,8 +41,6 @@ #include #include -#include - //============================================================================= // forward declaration @@ -74,7 +72,7 @@ namespace folly { namespace folly { template -class fbvector : private boost::totally_ordered> { +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 -- 2.34.1