File indexing completed on 2025-12-16 10:27:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef RANGES_V3_ALGORITHM_AUX_MERGE_N_WITH_BUFFER_HPP
0029 #define RANGES_V3_ALGORITHM_AUX_MERGE_N_WITH_BUFFER_HPP
0030
0031 #include <tuple>
0032
0033 #include <range/v3/range_fwd.hpp>
0034
0035 #include <range/v3/algorithm/aux_/merge_n.hpp>
0036 #include <range/v3/algorithm/copy_n.hpp>
0037 #include <range/v3/functional/comparisons.hpp>
0038 #include <range/v3/functional/identity.hpp>
0039 #include <range/v3/iterator/concepts.hpp>
0040 #include <range/v3/iterator/traits.hpp>
0041 #include <range/v3/utility/static_const.hpp>
0042
0043 #include <range/v3/detail/prologue.hpp>
0044
0045 namespace ranges
0046 {
0047 namespace aux
0048 {
0049 struct merge_n_with_buffer_fn
0050 {
0051 template(typename I, typename B, typename C = less, typename P = identity)(
0052 requires same_as<iter_common_reference_t<I>,
0053 iter_common_reference_t<B>> AND
0054 indirectly_copyable<I, B> AND mergeable<B, I, I, C, P, P>)
0055 I operator()(I begin0,
0056 iter_difference_t<I> n0,
0057 I begin1,
0058 iter_difference_t<I> n1,
0059 B buff,
0060 C r = C{},
0061 P p = P{}) const
0062 {
0063 copy_n(begin0, n0, buff);
0064 return merge_n(buff, n0, begin1, n1, begin0, r, p, p).out;
0065 }
0066 };
0067
0068 RANGES_INLINE_VARIABLE(merge_n_with_buffer_fn, merge_n_with_buffer)
0069 }
0070 }
0071
0072 #include <range/v3/detail/epilogue.hpp>
0073
0074 #endif