VCCC  2024.05
VisualCamp Common C++ library
mergeable.hpp
Go to the documentation of this file.
1 //
2 // Created by yonggyulee on 1/26/24.
3 //
4 
5 #ifndef VCCC_ITERATOR_MERGEABLE_HPP
6 #define VCCC_ITERATOR_MERGEABLE_HPP
7 
8 #include <type_traits>
9 
18 
19 namespace vccc {
20 namespace detail {
21 
22 template<
23  typename I1, typename I2, typename Out,
24  typename Comp, typename Proj1, typename Proj2,
25  bool = conjunction<
26  input_iterator<I1>, input_iterator<I2>,
27  projectable<I1, Proj1>, projectable<I2, Proj2>
28  >::value /* false */
29 >
30 struct mergeable_impl_1 : std::false_type {};
31 
32 template<typename I1, typename I2, typename Out, typename Comp, typename Proj1, typename Proj2>
33 struct mergeable_impl_1<I1, I2, Out, Comp, Proj1, Proj2, true>
34  : conjunction<
35  weakly_incrementable<Out>,
36  indirectly_copyable<I1, Out>,
37  indirectly_copyable<I2, Out>,
38  indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>
39  > {};
40 
41 } // namespace detail
42 
45 
46 template<typename I1, typename I2, typename Out,
47  typename Comp = ranges::less, typename Proj1 = identity, typename Proj2 = identity>
48 struct mergeable : detail::mergeable_impl_1<I1, I2, Out, Comp, Proj1, Proj2> {};
49 
51 
52 } // namespace vccc
53 
54 #endif // VCCC_ITERATOR_MERGEABLE_HPP
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: mergeable.hpp:48