VCCC  2024.05
VisualCamp Common C++ library
indirect_binary_predicate.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/29.
3 //
4 
5 #ifndef VCCC_ITERATOR_INDIRECT_BINARY_PREDICATE_HPP
6 #define VCCC_ITERATOR_INDIRECT_BINARY_PREDICATE_HPP
7 
8 #include <type_traits>
9 
17 
18 namespace vccc {
19 namespace detail {
20 
21 template<
22  typename F,
23  typename I1,
24  typename I2,
25  bool = conjunction<
26  has_typename_type<iter_common_reference<I1>>,
27  has_typename_type<iter_common_reference<I2>>
28  >::value /* true */
29 >
30 struct indirect_binary_predicate_impl_2
31  : conjunction<
32  predicate<F&, iter_value_t<I1>&, iter_value_t<I2>&>,
33  predicate<F&, iter_value_t<I1>&, iter_reference_t<I2>>,
34  predicate<F&, iter_reference_t<I1>&, iter_value_t<I2>&>,
35  predicate<F&, iter_reference_t<I1>&, iter_reference_t<I2>>,
36  predicate<F&, iter_common_reference_t<I1>&, iter_common_reference_t<I2>>
37  >{};
38 
39 template<typename F, typename I1, typename I2>
40 struct indirect_binary_predicate_impl_2<F, I1, I2, false> : std::false_type {};
41 
42 
43 template<
44  typename F,
45  typename I1,
46  typename I2,
47  bool = conjunction<
48  indirectly_readable<I1>,
49  indirectly_readable<I2>,
50  copy_constructible<F>
51  >::value /* true */
52 >
53 struct indirect_binary_predicate_impl_1 : indirect_binary_predicate_impl_2<F, I1, I2> {};
54 
55 template<typename F, typename I1, typename I2>
56 struct indirect_binary_predicate_impl_1<F, I1, I2, false> : std::false_type {};
57 
58 } // namespace detail
59 
62 
63 
74 template<typename F, typename I1, typename I2>
75 struct indirect_binary_predicate : detail::indirect_binary_predicate_impl_1<F, I1, I2> {};
76 
78 
79 } // namespace vccc
80 
81 #endif // VCCC_ITERATOR_INDIRECT_BINARY_PREDICATE_HPP
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
specifies that a callable type, when invoked with the result of dereferencing two indirectly_readable...
Definition: indirect_binary_predicate.hpp:75