]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/test/_include/support/equivalence_class.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / _include / support / equivalence_class.hpp
CommitLineData
b32b8144 1// Copyright Louis Dionne 2013-2017
7c673cae
FG
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4
5#ifndef TEST_SUPPORT_EQUIVALENCE_CLASS_HPP
6#define TEST_SUPPORT_EQUIVALENCE_CLASS_HPP
7
8#include <boost/hana/fwd/equal.hpp>
9
10
11struct EquivalenceClass { };
12
13template <typename Token, typename T>
14struct equivalence_class_impl {
15 Token equivalence_class;
16 T unwrap;
17 using hana_tag = EquivalenceClass;
18};
19
20template <typename Token, typename X>
21constexpr equivalence_class_impl<Token, X> equivalence_class(Token token, X x) {
22 return {token, x};
23}
24
25namespace boost { namespace hana {
26 template <>
27 struct equal_impl<EquivalenceClass, EquivalenceClass> {
28 template <typename X, typename Y>
29 static constexpr auto apply(X x, Y y)
30 { return hana::equal(x.equivalence_class, y.equivalence_class); }
31 };
32}} // end namespace boost::hana
33
34#endif // !TEST_SUPPORT_EQUIVALENCE_CLASS_HPP