VCCC  2024.05
VisualCamp Common C++ library
equality_comparable.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/24.
3 //
4 
5 #ifndef VCCC_CONCEPTS_EQUALITY_COMPARABLE_HPP_
6 #define VCCC_CONCEPTS_EQUALITY_COMPARABLE_HPP_
7 
14 
15 namespace vccc {
16 
19 
29 template<typename T>
31 
32 
33 namespace detail {
34 
35 template<
36  typename T,
37  typename U,
38  bool = has_typename_type<
40  const std::remove_reference_t<U>& >
41  >::value /* true */
42 >
43 struct equality_comparable_with_impl_2
44  : conjunction<
45  equality_comparable<
46  common_reference_t< const std::remove_reference_t<T>&,
47  const std::remove_reference_t<U>&> >,
48  weakly_equality_comparable_with<T, U>
49  >{};
50 
51 template<typename T, typename U>
52 struct equality_comparable_with_impl_2<T, U, false> : std::false_type {};
53 
54 template<
55  typename T,
56  typename U,
57  bool = conjunction<
58  equality_comparable<T>,
59  equality_comparable<U>,
60  comparison_common_type_with<T, U>
61  >::value /* true */
62 >
63 struct equality_comparable_with_impl_1 : equality_comparable_with_impl_2<T, U> {};
64 template<typename T, typename U>
65 struct equality_comparable_with_impl_1<T, U, false> : std::false_type {};
66 
67 } // namespace detail
68 
78 template<typename T, typename U>
79 struct equality_comparable_with : detail::equality_comparable_with_impl_1<T, U> {};
80 
82 
83 } // namespace vccc
84 
85 #endif // VCCC_CONCEPTS_EQUALITY_COMPARABLE_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: common_reference.hpp:51
Definition: conjunction.hpp:22
specifies that operator == is an equivalence relation
Definition: equality_comparable.hpp:79
specifies that operator == is an equivalence relation
Definition: equality_comparable.hpp:30
Definition: has_typename_type.hpp:18
specifies that two different objects can be compared for equality with each other (in either order) u...
Definition: weakly_equality_comparable_with.hpp:51