VCCC  2024.05
VisualCamp Common C++ library
indirectly_comparable.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/29.
3 //
4 
5 #ifndef VCCC_ITERATOR_INDIRECTLY_COMPARABLE_HPP
6 #define VCCC_ITERATOR_INDIRECTLY_COMPARABLE_HPP
7 
8 #include <type_traits>
9 
15 
16 namespace vccc {
17 namespace detail {
18 
19 template<
20  typename I1,
21  typename I2,
22  typename Comp,
23  typename Proj1,
24  typename Proj2,
25  bool = conjunction<projectable<I1, Proj1>, projectable<I2, Proj2>>::value /* true */
26 >
27 struct indirectly_comparable_impl
28  : indirect_binary_predicate<Comp, projected<I1, Proj1>, projected<I2, Proj2>> {};
29 
30 template<typename I1, typename I2, typename Comp, typename Proj1, typename Proj2>
31 struct indirectly_comparable_impl<I1, I2, Comp, Proj1, Proj2, false> : std::false_type {};
32 
33 } // namespace detail
34 
37 
47 template<typename I1, typename I2, typename Comp,
48  typename Proj1 = identity, typename Proj2 = identity>
49 struct indirectly_comparable : detail::indirectly_comparable_impl<I1, I2, Comp, Proj1, Proj2> {};
50 
52 
53 } // namespace vccc
54 
55 #endif // VCCC_ITERATOR_INDIRECTLY_COMPARABLE_HPP
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that the values referenced by two indirectly_readable types can be compared
Definition: indirectly_comparable.hpp:49