Header file range/v3/view/iota.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

#include <range/v3/range_concepts.hpp>

#include <range/v3/view_facade.hpp>

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

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

#include <range/v3/view/take_exactly.hpp>

#include <range/v3/view/delimit.hpp>

namespace ranges
{
    inline namespace v3
    {
        namespace concepts
        {
            struct BidirectionalIncrementable
            : refines<struct ranges::v3::concepts::Incrementable>
            {
                template <typename T>
                decltype(concepts::valid_expr(concepts::has_type<T&>(--t), concepts::has_type<T>(t--))) requires_(T&& t);
            };
            
            struct RandomAccessIncrementable
            : refines<struct ranges::v3::concepts::BidirectionalIncrementable>
            {
                template <typename T>
                decltype(concepts::valid_expr(concepts::model_of<Integral>(t-t), concepts::has_type<T&>(t+=(t-t)), concepts::has_type<T&>(t-=(t-t)), concepts::convertible_to<T>(t-(t-t)), concepts::convertible_to<T>(t+(t-t)), concepts::convertible_to<T>((t-t)+t))) requires_(T&& t);
            };
        }
        
        template <typename T>
        using BidirectionalIncrementable = concepts::models<concepts::BidirectionalIncrementable, T>;
        
        template <typename T>
        using RandomAccessIncrementable = concepts::models<concepts::RandomAccessIncrementable, T>;
        
        template <typename T>
        using incrementable_concept = concepts::most_refined<meta::list<concepts::RandomAccessIncrementable, concepts::BidirectionalIncrementable, concepts::Incrementable, concepts::WeaklyIncrementable>, T>;
        
        template <typename T>
        using incrementable_concept_t = meta::_t<incrementable_concept<T>>;
        
        namespace detail
        {
            template <typename Val, typename Iota = incrementable_concept_t<Val>, bool IsIntegral = std::is_integral<Val>::value>
            struct iota_difference_
            : ranges::difference_type<Val>
            {};
            
            template <typename Val>
            struct iota_difference_<Val, concepts::RandomAccessIncrementable, true>
            {
                using type = meta::if_<meta::not_<std::is_same<Val, difference_t>>, meta::_t<std::make_signed<difference_t>>, meta::if_c<(bits<8), std::int_fast8_t, meta::if_c<(bits<16), std::int_fast16_t, meta::if_c<(bits<32), std::int_fast32_t, std::int_fast64_t>>>>;
            };
            
            template <typename Val>
            struct iota_difference
            : iota_difference_<Val>
            {};
            
            template <typename Val>
            using iota_difference_t = meta::_t<iota_difference<Val>>;
            
            template <typename Val, int _concept_requires_121 = 42, typename std::enable_if<(_concept_requires_121==43)||(!Integral<Val>()), int>::type=0>
            iota_difference_t<Val> iota_minus(Val const& v0, Val const& v1);
            
            template <typename Val, int _concept_requires_127 = 42, typename std::enable_if<(_concept_requires_127==43)||(SignedIntegral<Val>()), int>::type=0>
            iota_difference_t<Val> iota_minus(Val const& v0, Val const& v1);
            
            template <typename Val, int _concept_requires_134 = 42, typename std::enable_if<(_concept_requires_134==43)||(UnsignedIntegral<Val>()), int>::type=0>
            iota_difference_t<Val> iota_minus(Val const& v0, Val const& v1);
            
            template <typename Val, typename C = common_type_t<Val, iota_difference_t<Val>>>
            decltype(static_cast<Val>(static_cast<C>(v)+static_cast<C>(n))) iota_plus_(Val const& v, iota_difference_t<Val> n, std::true_type) noexcept(noexcept(decltype(static_cast<Val>(static_cast<C>(v)+static_cast<C>(n)))(static_cast<Val>(static_cast<C>(v)+static_cast<C>(n)))));
            
            template <typename Val>
            decltype(v+n) iota_plus_(Val const& v, iota_difference_t<Val> n, std::false_type) noexcept(noexcept(decltype(v+n)(v+n)));
            
            template <typename Val>
            decltype(detail::iota_plus_(v, n, Integral<Val>{})) iota_plus(Val const& v, iota_difference_t<Val> n) noexcept(noexcept(decltype(detail::iota_plus_(v, n, Integral<Val>{}))(detail::iota_plus_(v, n, Integral<Val>{}))));
        }
        
        template <typename From, typename To>
        struct closed_iota_view;
        
        template <typename From, typename To>
        struct iota_view
        : view_facade<iota_view<From, To>, finite>
        {
            iota_view() = default;
            
            constexpr iota_view(From from, To to);
        };
        
        template <typename From>
        struct iota_view<From, void>
        : view_facade<iota_view<From, void>, infinite>
        {
            iota_view() = default;
            
            explicit constexpr iota_view(From value);
        };
        
        namespace view
        {
            struct iota_fn
            {
                template <typename From, int _concept_requires_345 = 42, typename std::enable_if<(_concept_requires_345==43)||(WeaklyIncrementable<From>()), int>::type=0>
                iota_view<From> operator()(From value) const;
                
                template <typename From, typename To>
                meta::if_c<WeaklyIncrementable<From>()&&EqualityComparable<From, To>(), meta::if_<meta::and_<RandomAccessIncrementable<From>, Same<From, To>>, detail::take_exactly_view_<iota_view<From>, true>, iota_view<From, To>>> operator()(From from, To to) const;
                
                template <typename From, int _concept_requires_361 = 42, typename std::enable_if<(_concept_requires_361==43)||(!WeaklyIncrementable<From>()), int>::type=0>
                void operator()(From) const;
                
                template <typename From, typename To, int _concept_requires_370 = 42, typename std::enable_if<(_concept_requires_370==43)||(!(WeaklyIncrementable<From>()&&EqualityComparable<From, To>())), int>::type=0>
                void operator()(From, To) const;
            };
            
            struct closed_iota_fn
            {
                template <typename From, typename To, int _concept_requires_412 = 42, typename std::enable_if<(_concept_requires_412==43)||(WeaklyIncrementable<From>()&&EqualityComparable<From, To>()), int>::type=0>
                meta::if_<meta::and_<RandomAccessIncrementable<From>, Same<From, To>>, detail::take_exactly_view_<iota_view<From>, true>, closed_iota_view<From, To>> operator()(From from, To to) const;
                
                template <typename From, typename To, int _concept_requires_423 = 42, typename std::enable_if<(_concept_requires_423==43)||(!(WeaklyIncrementable<From>()&&EqualityComparable<From, To>())), int>::type=0>
                void operator()(From, To) const;
            };
            
            inline namespace 
            {
                constexpr auto& iota = static_const<iota_fn>::value;
            }
            
            inline namespace 
            {
                constexpr auto& closed_iota = static_const<closed_iota_fn>::value;
            }
            
            struct ints_fn
            : iota_view<int>
            {
                ints_fn() = default;
                
                template <typename Val, int _concept_requires_450 = 42, typename std::enable_if<(_concept_requires_450==43)||(Integral<Val>()), int>::type=0>
                iota_view<Val> operator()(Val value) const;
                
                template <typename Val>
                meta::if_c<(bool)Integral<Val>(), detail::take_exactly_view_<iota_view<Val>, true>> operator()(Val from, Val to) const;
                
                template <typename Val, int _concept_requires_463 = 42, typename std::enable_if<(_concept_requires_463==43)||(!Integral<Val>()), int>::type=0>
                void operator()(Val) const;
                
                template <typename Val, int _concept_requires_470 = 42, typename std::enable_if<(_concept_requires_470==43)||(!Integral<Val>()), int>::type=0>
                void operator()(Val, Val) const;
            };
            
            struct closed_ints_fn
            {
                template <typename Val, int _concept_requires_491 = 42, typename std::enable_if<(_concept_requires_491==43)||(Integral<Val>()), int>::type=0>
                detail::take_exactly_view_<iota_view<Val>, true> operator()(Val from, Val to) const;
                
                template <typename Val, int _concept_requires_498 = 42, typename std::enable_if<(_concept_requires_498==43)||(!Integral<Val>()), int>::type=0>
                void operator()(Val, Val) const;
            };
            
            inline namespace 
            {
                constexpr auto& ints = static_const<ints_fn>::value;
            }
            
            inline namespace 
            {
                constexpr auto& closed_ints = static_const<closed_ints_fn>::value;
            }
        }
    }
}

Class template ranges::v3::closed_iota_view<From, To>

template <typename From, typename To>
struct closed_iota_view
: view_facade<closed_iota_view<From, To>, finite>
{
    closed_iota_view() = default;
    
    constexpr closed_iota_view(From from, To to);
};

An iota view in a closed range with non-random access iota value type