Commit 9c20a858 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Drop <boost/operators.hpp> as a dependency of FBVector.h

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
parent ca73efa8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment