Header file range/v3/utility/tuple_algorithm.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

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

namespace ranges
{
    inline namespace v3
    {
        template <typename Tup>
        using tuple_indices_t = meta::make_index_sequence<std::tuple_size<typename std::remove_reference<Tup>::type>::value>;
        
        struct tuple_apply_fn
        {
            template <typename Fun, typename Tup>
            decltype(tuple_apply_fn::impl(std::forward<Fun>(fun), std::forward<Tup>(tup), tuple_indices_t<Tup>{})) operator()(Fun&& fun, Tup&& tup) const noexcept(noexcept(decltype(tuple_apply_fn::impl(std::forward<Fun>(fun), std::forward<Tup>(tup), tuple_indices_t<Tup>{}))(tuple_apply_fn::impl(std::forward<Fun>(fun), std::forward<Tup>(tup), tuple_indices_t<Tup>{}))));
        };
        
        inline namespace 
        {
            constexpr auto& tuple_apply = static_const<tuple_apply_fn>::value;
        }
        
        struct tuple_transform_fn
        {
            template <typename Tup, typename Fun>
            decltype(tuple_transform_fn::impl1(std::forward<Tup>(tup), std::move(fun), tuple_indices_t<Tup>{})) operator()(Tup&& tup, Fun fun) const noexcept(noexcept(decltype(tuple_transform_fn::impl1(std::forward<Tup>(tup), std::move(fun), tuple_indices_t<Tup>{}))(tuple_transform_fn::impl1(std::forward<Tup>(tup), std::move(fun), tuple_indices_t<Tup>{}))));
            
            template <typename Tup0, typename Tup1, typename Fun>
            decltype(tuple_transform_fn::impl2(std::forward<Tup0>(tup0), std::forward<Tup1>(tup1), std::move(fun), tuple_indices_t<Tup0>{})) operator()(Tup0&& tup0, Tup1&& tup1, Fun fun) const noexcept(noexcept(decltype(tuple_transform_fn::impl2(std::forward<Tup0>(tup0), std::forward<Tup1>(tup1), std::move(fun), tuple_indices_t<Tup0>{}))(tuple_transform_fn::impl2(std::forward<Tup0>(tup0), std::forward<Tup1>(tup1), std::move(fun), tuple_indices_t<Tup0>{}))));
        };
        
        inline namespace 
        {
            constexpr auto& tuple_transform = static_const<tuple_transform_fn>::value;
        }
        
        struct tuple_foldl_fn
        {
            template <typename Tup, typename Val, typename Fun>
            decltype(tuple_foldl_fn::impl2(std::forward<Tup>(tup), std::move(val), std::move(fun), tuple_indices_t<Tup>{})) operator()(Tup&& tup, Val val, Fun fun) const noexcept(noexcept(decltype(tuple_foldl_fn::impl2(std::forward<Tup>(tup), std::move(val), std::move(fun), tuple_indices_t<Tup>{}))(tuple_foldl_fn::impl2(std::forward<Tup>(tup), std::move(val), std::move(fun), tuple_indices_t<Tup>{}))));
        };
        
        inline namespace 
        {
            constexpr auto& tuple_foldl = static_const<tuple_foldl_fn>::value;
        }
        
        struct tuple_for_each_fn
        {
            template <typename Tup, typename Fun>
            Fun operator()(Tup&& tup, Fun fun) const;
        };
        
        inline namespace 
        {
            constexpr auto& tuple_for_each = static_const<tuple_for_each_fn>::value;
        }
        
        struct make_tuple_fn
        {
            template <typename ... Ts>
            decltype(std::make_tuple(std::forward<Ts>(ts)...)) operator()(Ts&&... ts) const noexcept(noexcept(decltype(std::make_tuple(std::forward<Ts>(ts)...))(std::make_tuple(std::forward<Ts>(ts)...))));
        };
        
        inline namespace 
        {
            constexpr auto& make_tuple = static_const<make_tuple_fn>::value;
        }
    }
}

Alias template ranges::v3::tuple_indices_t<Tup>

template <typename Tup>
using tuple_indices_t = meta::make_index_sequence<std::tuple_size<typename std::remove_reference<Tup>::type>::value>;

@{


Variable ranges::v3::tuple_apply

constexpr auto& tuple_apply = static_const<tuple_apply_fn>::value;

tuple_apply_fn


Variable ranges::v3::tuple_transform

constexpr auto& tuple_transform = static_const<tuple_transform_fn>::value;

tuple_transform_fn


Variable ranges::v3::tuple_foldl

constexpr auto& tuple_foldl = static_const<tuple_foldl_fn>::value;

tuple_foldl_fn


Variable ranges::v3::tuple_for_each

constexpr auto& tuple_for_each = static_const<tuple_for_each_fn>::value;

tuple_for_each_fn


Variable ranges::v3::make_tuple

constexpr auto& make_tuple = static_const<make_tuple_fn>::value;

make_tuple_fn