VCCC  2024.05
VisualCamp Common C++ library
indirectly_unary_invocable.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 2023/12/29.
3 //
4 
5 #ifndef VCCC_ITERATOR_INDIRECT_UNARY_INVOCABLE_HPP
6 #define VCCC_ITERATOR_INDIRECT_UNARY_INVOCABLE_HPP
7 
8 #include <type_traits>
9 
20 
21 namespace vccc {
22 namespace detail {
23 
24 template<
25  typename F,
26  typename I,
27  bool v = conjunction<
28  invocable<F&, iter_value_t<I>&>,
29  invocable<F&, iter_reference_t<I>>,
30  invocable<F&, iter_common_reference_t<I>>
31  >::value /* true */
32 >
33 struct indirectly_unary_invocable_impl_2
34  : common_reference_with<
35  invoke_result_t<F&, iter_value_t<I>&>,
36  invoke_result_t<F&, iter_reference_t<I>>
37  > {};
38 
39 template<typename F, typename I>
40 struct indirectly_unary_invocable_impl_2<F, I, false> : std::false_type {};
41 
42 template<
43  typename F,
44  typename I,
45  bool v = conjunction<
46  indirectly_readable<I>,
47  copy_constructible<F>,
48  has_typename_type< iter_common_reference<I> >
49  >::value /* true */
50 >
51 struct indirectly_unary_invocable_impl_1 : indirectly_unary_invocable_impl_2<F, I> {};
52 
53 template<typename F, typename I>
54 struct indirectly_unary_invocable_impl_1<F, I, false> : std::false_type {};
55 
56 
57 } // namespace detail
58 
61 
72 template<typename F, typename I>
73 struct indirectly_unary_invocable : detail::indirectly_unary_invocable_impl_1<F, I> {};
74 
76 
77 } // namespace vccc
78 
79 #endif // VCCC_ITERATOR_INDIRECT_UNARY_INVOCABLE_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 can be invoked with the result of dereferencing an indirectly_readable...
Definition: indirectly_unary_invocable.hpp:73