Header file range/v3/numeric/accumulate.hpp

#include <meta/meta.hpp>

#include <range/v3/begin_end.hpp>

#include <range/v3/range_traits.hpp>

#include <range/v3/range_concepts.hpp>

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

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

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

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

namespace ranges
{
    inline namespace v3
    {
        template <typename I, typename T, typename Op = plus, typename P = ident, typename V = iterator_value_t<I>, typename X = concepts::Callable::result_t<P, V>, typename Y = concepts::Callable::result_t<Op, T, X>>
        using Accumulateable = meta::strict_and<InputIterator<I>, Callable<P, V>, Callable<Op, T, X>, Assignable<T&, Y>>;
        
        struct accumulate_fn
        {
            template <typename I, typename S, typename T, typename Op = plus, typename P = ident, int _concept_requires_42 = 42, typename std::enable_if<(_concept_requires_42==43)||(Sentinel<S, I>()&&Accumulateable<I, T, Op, P>()), int>::type=0>
            T operator()(I begin, S end, T init, Op op_ = Op{}, P proj_ = P{}) const;
            
            template <typename Rng, typename T, typename Op = plus, typename P = ident, typename I = range_iterator_t<Rng>, int _concept_requires_54 = 42, typename std::enable_if<(_concept_requires_54==43)||(Range<Rng>()&&Accumulateable<I, T, Op, P>()), int>::type=0>
            T operator()(Rng&& rng, T init, Op op = Op{}, P proj = P{}) const;
        };
        
        inline namespace 
        {
            constexpr auto& accumulate = static_const<with_braced_init_args<accumulate_fn>>::value;
        }
    }
}