Skip to content

Commit

Permalink
Delete CompareWrap
Browse files Browse the repository at this point in the history
Summary: It's unused. We don't even have unit-test for it: https://fburl.com/code/kmhbamf8

Reviewed By: createdbysk

Differential Revision: D67063698

fbshipit-source-id: a2efe00af8dba310ade20449d4c2691b4c728c44
  • Loading branch information
TJ Yin authored and facebook-github-bot committed Dec 11, 2024
1 parent c28ac06 commit f9b10e6
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions third-party/thrift/src/thrift/lib/cpp2/type/detail/Wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,36 +151,6 @@ class EqWrap : public Wrap<T, Tag>, public BaseDerived<Derived> {
}
};

template <typename Derived, typename T, typename Tag = infer_tag<T>>
class CompareWrap : public EqWrap<Derived, T, Tag> {
using Base = EqWrap<Derived, T, Tag>;

public:
using Base::Base;

protected:
using Base::data;
~CompareWrap() = default; // abstract base class

constexpr static folly::ordering cmp(const Derived& lhs, const Derived& rhs) {
return op::compare<Tag>(data(lhs), data(rhs));
}

private:
friend constexpr bool operator<(const Derived& lhs, const Derived& rhs) {
return op::detail::is_lt(cmp(lhs, rhs));
}
friend constexpr bool operator<=(const Derived& lhs, const Derived& rhs) {
return op::detail::is_lteq(cmp(lhs, rhs));
}
friend constexpr bool operator>(const Derived& lhs, const Derived& rhs) {
return op::detail::is_gt(cmp(lhs, rhs));
}
friend constexpr bool operator>=(const Derived& lhs, const Derived& rhs) {
return op::detail::is_gteq(cmp(lhs, rhs));
}
};

// The custom specialization of std::hash injected into the std namespace.
#define FBTHRIFT_STD_HASH_WRAP_DATA(fullType) \
namespace std { \
Expand Down

0 comments on commit f9b10e6

Please sign in to comment.