VCCC  2024.05
VisualCamp Common C++ library
totally_ordered.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/25.
3 //
4 
5 #ifndef VCCC_CONCEPTS_TOTALLY_ORDERED_HPP_
6 #define VCCC_CONCEPTS_TOTALLY_ORDERED_HPP_
7 
8 #include <type_traits>
9 
14 
15 namespace vccc {
16 
19 
20 
31 template<typename T>
33  : conjunction<
34  equality_comparable<T>,
35  partially_ordered_with<T, T>
36  >{};
37 
38 
39 namespace detail {
40 
41 template<
42  typename T,
43  typename U,
44  bool = conjunction<
48  >::value /* false */
49 >
50 struct totally_ordered_with_impl : std::false_type {};
51 
52 template<typename T, typename U>
53 struct totally_ordered_with_impl<T, U, true>
54  : conjunction<
55  totally_ordered<
56  common_reference_t< const std::remove_reference_t<T>&,
57  const std::remove_reference_t<U>&> >,
58  partially_ordered_with<T, U>
59  > {};
60 
61 } // namespace detail
62 
73 template<typename T, typename U>
74 struct totally_ordered_with : detail::totally_ordered_with_impl<T, U> {};
75 
77 
78 } // namespace vccc
79 
80 #endif // VCCC_CONCEPTS_TOTALLY_ORDERED_HPP_
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: conjunction.hpp:22
specifies that operator == is an equivalence relation
Definition: equality_comparable.hpp:79
specifies that the comparison operators on the type yield a total order
Definition: totally_ordered.hpp:74
specifies that the comparison operators on the type yield a total order
Definition: totally_ordered.hpp:36