Header file range/v3/action/insert.hpp

#include <range/v3/range_fwd.hpp>

#include <range/v3/begin_end.hpp>

#include <range/v3/range_traits.hpp>

#include <range/v3/utility/functional.hpp>

#include <range/v3/utility/common_iterator.hpp>

#include <range/v3/action/concepts.hpp>

#include <range/v3/utility/static_const.hpp>

namespace ranges
{
    inline namespace v3
    {
        namespace adl_insert_detail
        {
            template <typename Cont, typename T, int _concept_requires_36 = 42, typename std::enable_if<(_concept_requires_36==43)||(LvalueContainerLike<Cont>()&&Constructible<range_value_t<Cont>, T&&>()), int>::type=0>
            decltype(unwrap_reference(cont).insert(std::forward<T>(t))) insert(Cont&& cont, T&& t);
            
            template <typename Cont, typename I, typename S, typename C = common_iterator<I, S>, int _concept_requires_45 = 42, typename std::enable_if<(_concept_requires_45==43)||(LvalueContainerLike<Cont>()&&Sentinel<S, I>()), int>::type=0>
            decltype(unwrap_reference(cont).insert(C{i}, C{j})) insert(Cont&& cont, I i, S j);
            
            template <typename Cont, typename Rng, typename C = range_common_iterator_t<Rng>, int _concept_requires_54 = 42, typename std::enable_if<(_concept_requires_54==43)||(LvalueContainerLike<Cont>()&&Range<Rng>()), int>::type=0>
            decltype(unwrap_reference(cont).insert(C{begin(rng)}, C{end(rng)})) insert(Cont&& cont, Rng&& rng);
            
            template <typename Cont, typename I, typename T, int _concept_requires_62 = 42, typename std::enable_if<(_concept_requires_62==43)||(LvalueContainerLike<Cont>()&&Iterator<I>()&&Constructible<range_value_t<Cont>, T&&>()), int>::type=0>
            decltype(unwrap_reference(cont).insert(p, std::forward<T>(t))) insert(Cont&& cont, I p, T&& t);
            
            template <typename Cont, typename I, typename N, typename T, int _concept_requires_71 = 42, typename std::enable_if<(_concept_requires_71==43)||(LvalueContainerLike<Cont>()&&Iterator<I>()&&Integral<N>()&&Constructible<range_value_t<Cont>, T&&>()), int>::type=0>
            decltype(unwrap_reference(cont).insert(p, n, std::forward<T>(t))) insert(Cont&& cont, I p, N n, T&& t);
            
            namespace detail
            {
                template <typename Cont, typename P, typename I, typename S, typename C = common_iterator<I, S>, int _concept_requires_84 = 42, typename std::enable_if<(_concept_requires_84==43)||(LvalueContainerLike<Cont>()&&Iterator<P>()&&Sentinel<S, I>()), int>::type=0>
                decltype(unwrap_reference(cont).insert(p, C{i}, C{j})) insert_impl(Cont&& cont, P p, I i, S j, std::false_type);
                
                template <typename Cont, typename P, typename I, typename S, typename C = common_iterator<I, S>, int _concept_requires_93 = 42, typename std::enable_if<(_concept_requires_93==43)||(LvalueContainerLike<Cont>()&&Iterator<P>()&&SizedSentinel<S, I>()&&RandomAccessReservable<Cont>()), int>::type=0>
                decltype(unwrap_reference(cont).insert(begin(unwrap_reference(cont)), C{i}, C{j})) insert_impl(Cont&& cont, P p, I i, S j, std::true_type);
                
                template <typename Cont, typename I, typename Rng, typename C = range_common_iterator_t<Rng>, int _concept_requires_107 = 42, typename std::enable_if<(_concept_requires_107==43)||(LvalueContainerLike<Cont>()&&Iterator<I>()&&Range<Rng>()), int>::type=0>
                decltype(unwrap_reference(cont).insert(p, C{begin(rng)}, C{end(rng)})) insert_impl(Cont&& cont, I p, Rng&& rng, std::false_type);
                
                template <typename Cont, typename I, typename Rng, typename C = range_common_iterator_t<Rng>, int _concept_requires_116 = 42, typename std::enable_if<(_concept_requires_116==43)||(LvalueContainerLike<Cont>()&&Iterator<I>()&&SizedRange<Rng>()&&RandomAccessReservable<Cont>()), int>::type=0>
                decltype(unwrap_reference(cont).insert(begin(unwrap_reference(cont)), C{begin(rng)}, C{end(rng)})) insert_impl(Cont&& cont, I p, Rng&& rng, std::true_type);
            }
            
            template <typename Cont, typename P, typename I, typename S, typename C = common_iterator<I, S>, int _concept_requires_131 = 42, typename std::enable_if<(_concept_requires_131==43)||(LvalueContainerLike<Cont>()&&Iterator<P>()&&Sentinel<S, I>()), int>::type=0>
            decltype(detail::insert_impl(std::forward<Cont>(cont), std::move(p), std::move(i), std::move(j), meta::strict_and<RandomAccessReservable<Cont>, SizedSentinel<S, I>>{})) insert(Cont&& cont, P p, I i, S j);
            
            template <typename Cont, typename I, typename Rng, typename C = range_common_iterator_t<Rng>, int _concept_requires_141 = 42, typename std::enable_if<(_concept_requires_141==43)||(LvalueContainerLike<Cont>()&&Iterator<I>()&&Range<Rng>()), int>::type=0>
            decltype(detail::insert_impl(std::forward<Cont>(cont), std::move(p), std::forward<Rng>(rng), meta::strict_and<RandomAccessReservable<Cont>, SizedRange<Rng>>{})) insert(Cont&& cont, I p, Rng&& rng);
            
            struct insert_fn
            {
                template <typename Rng, typename T, int _concept_requires_152 = 42, typename std::enable_if<(_concept_requires_152==43)||(Range<Rng>()&&Constructible<range_value_t<Rng>, T&&>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), std::forward<T>(t))) operator()(Rng&& rng, T&& t) const;
                
                template <typename Rng, typename Rng2, int _concept_requires_160 = 42, typename std::enable_if<(_concept_requires_160==43)||(Range<Rng>()&&Range<Rng2>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), std::forward<Rng2>(rng2))) operator()(Rng&& rng, Rng2&& rng2) const;
                
                template <typename Rng, typename T, int _concept_requires_170 = 42, typename std::enable_if<(_concept_requires_170==43)||(Range<Rng>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), rng2)) operator()(Rng&& rng, std::initializer_list<T> rng2) const;
                
                template <typename Rng, typename I, typename S, int _concept_requires_178 = 42, typename std::enable_if<(_concept_requires_178==43)||(Range<Rng>()&&Sentinel<S, I>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), i, j)) operator()(Rng&& rng, I i, S j) const;
                
                template <typename Rng, typename I, typename T, int _concept_requires_186 = 42, typename std::enable_if<(_concept_requires_186==43)||(Range<Rng>()&&Iterator<I>()&&Constructible<range_value_t<Rng>, T&&>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), p, std::forward<T>(t))) operator()(Rng&& rng, I p, T&& t) const;
                
                template <typename Rng, typename I, typename Rng2, int _concept_requires_195 = 42, typename std::enable_if<(_concept_requires_195==43)||(Range<Rng>()&&Iterator<I>()&&Range<Rng2>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), p, std::forward<Rng2>(rng2))) operator()(Rng&& rng, I p, Rng2&& rng2) const;
                
                template <typename Rng, typename I, typename T, int _concept_requires_205 = 42, typename std::enable_if<(_concept_requires_205==43)||(Range<Rng>()&&Iterator<I>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), p, rng2)) operator()(Rng&& rng, I p, std::initializer_list<T> rng2) const;
                
                template <typename Rng, typename I, typename N, typename T, int _concept_requires_213 = 42, typename std::enable_if<(_concept_requires_213==43)||(Range<Rng>()&&Iterator<I>()&&Integral<N>()&&Constructible<range_value_t<Rng>, T&&>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), p, n, std::forward<T>(t))) operator()(Rng&& rng, I p, N n, T&& t) const;
                
                template <typename Rng, typename P, typename I, typename S, int _concept_requires_222 = 42, typename std::enable_if<(_concept_requires_222==43)||(Range<Rng>()&&Iterator<P>()&&Sentinel<S, I>()), int>::type=0>
                decltype(insert(std::forward<Rng>(rng), p, i, j)) operator()(Rng&& rng, P p, I i, S j) const;
            };
        }
        
        inline namespace 
        {
            constexpr auto& insert = static_const<adl_insert_detail::insert_fn>::value;
        }
        
        namespace action
        {
            using ranges::insert;
        }
        
        namespace concepts
        {
            struct InsertableRange;
        }
        
        template <typename Rng, typename ... Rest>
        using InsertableRange = concepts::models<concepts::InsertableRange, Rng, Rest...>;
    }
}