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

Cut use of boost headers in sorted_vector_types.h

Summary: [Folly] Cut use of boost headers in `sorted_vector_types.h`.

Reviewed By: elsteveogrande

Differential Revision: D9508079

fbshipit-source-id: 46950a07d1fbc0e316bd6a8cb9766f5d0aeaa74b
parent 4a45caa3
...@@ -69,8 +69,6 @@ ...@@ -69,8 +69,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include <boost/operators.hpp>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/Utility.h> #include <folly/Utility.h>
#include <folly/lang/Exception.h> #include <folly/lang/Exception.h>
...@@ -227,10 +225,7 @@ template < ...@@ -227,10 +225,7 @@ template <
class Allocator = std::allocator<T>, class Allocator = std::allocator<T>,
class GrowthPolicy = void, class GrowthPolicy = void,
class Container = std::vector<T, Allocator>> class Container = std::vector<T, Allocator>>
class sorted_vector_set class sorted_vector_set : detail::growth_policy_wrapper<GrowthPolicy> {
: boost::totally_ordered1<
sorted_vector_set<T, Compare, Allocator, GrowthPolicy>,
detail::growth_policy_wrapper<GrowthPolicy>> {
detail::growth_policy_wrapper<GrowthPolicy>& detail::growth_policy_wrapper<GrowthPolicy>&
get_growth_policy() { return *this; } get_growth_policy() { return *this; }
...@@ -482,10 +477,22 @@ class sorted_vector_set ...@@ -482,10 +477,22 @@ class sorted_vector_set
bool operator==(const sorted_vector_set& other) const { bool operator==(const sorted_vector_set& other) const {
return other.m_.cont_ == m_.cont_; return other.m_.cont_ == m_.cont_;
} }
bool operator!=(const sorted_vector_set& other) const {
return !operator==(other);
}
bool operator<(const sorted_vector_set& other) const { bool operator<(const sorted_vector_set& other) const {
return m_.cont_ < other.m_.cont_; return m_.cont_ < other.m_.cont_;
} }
bool operator>(const sorted_vector_set& other) const {
return other < *this;
}
bool operator<=(const sorted_vector_set& other) const {
return !operator>(other);
}
bool operator>=(const sorted_vector_set& other) const {
return !operator<(other);
}
const value_type* data() const noexcept { const value_type* data() const noexcept {
return m_.cont_.data(); return m_.cont_.data();
...@@ -557,10 +564,7 @@ template < ...@@ -557,10 +564,7 @@ template <
class Allocator = std::allocator<std::pair<Key, Value>>, class Allocator = std::allocator<std::pair<Key, Value>>,
class GrowthPolicy = void, class GrowthPolicy = void,
class Container = std::vector<std::pair<Key, Value>, Allocator>> class Container = std::vector<std::pair<Key, Value>, Allocator>>
class sorted_vector_map class sorted_vector_map : detail::growth_policy_wrapper<GrowthPolicy> {
: boost::totally_ordered1<
sorted_vector_map<Key, Value, Compare, Allocator, GrowthPolicy>,
detail::growth_policy_wrapper<GrowthPolicy>> {
detail::growth_policy_wrapper<GrowthPolicy>& detail::growth_policy_wrapper<GrowthPolicy>&
get_growth_policy() { return *this; } get_growth_policy() { return *this; }
...@@ -839,10 +843,22 @@ class sorted_vector_map ...@@ -839,10 +843,22 @@ class sorted_vector_map
bool operator==(const sorted_vector_map& other) const { bool operator==(const sorted_vector_map& other) const {
return m_.cont_ == other.m_.cont_; return m_.cont_ == other.m_.cont_;
} }
bool operator!=(const sorted_vector_map& other) const {
return !operator==(other);
}
bool operator<(const sorted_vector_map& other) const { bool operator<(const sorted_vector_map& other) const {
return m_.cont_ < other.m_.cont_; return m_.cont_ < other.m_.cont_;
} }
bool operator>(const sorted_vector_map& other) const {
return other < *this;
}
bool operator<=(const sorted_vector_map& other) const {
return !operator>(other);
}
bool operator>=(const sorted_vector_map& other) const {
return !operator<(other);
}
const value_type* data() const noexcept { const value_type* data() const noexcept {
return m_.cont_.data(); return m_.cont_.data();
......
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