Header file range/v3/view/cycle.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

#include <range/v3/size.hpp>

#include <range/v3/distance.hpp>

#include <range/v3/begin_end.hpp>

#include <range/v3/range_traits.hpp>

#include <range/v3/range_concepts.hpp>

#include <range/v3/view_facade.hpp>

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

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

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

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

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

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

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

namespace ranges
{
    inline namespace v3
    {
        namespace detail
        {
            template <typename Rng>
            using cycle_end_ = meta::if_<BoundedRange<Rng>, meta::nil_, box<optional<range_iterator_t<Rng>>, end_tag>>;
        }
        
        template <typename Rng>
        struct cycled_view;
        
        namespace view
        {
            struct cycle_fn
            {
                template <typename Rng, int _concept_requires_213 = 42, typename std::enable_if<(_concept_requires_213==43)||(Concept<Rng>()), int>::type=0>
                cycled_view<all_t<Rng>> operator()(Rng&& rng) const;
                
                template <typename Rng, int _concept_requires_220 = 42, typename std::enable_if<(_concept_requires_220==43)||(!Concept<Rng>()), int>::type=0>
                void operator()(Rng&&) const;
            };
            
            inline namespace 
            {
                constexpr auto& cycle = static_const<view<cycle_fn>>::value;
            }
        }
    }
}

Class template ranges::v3::cycled_view<Rng>

template <typename Rng>
struct cycled_view
: view_facade<cycled_view<Rng>, infinite>
{
    cycled_view() = default;
    
    cycled_view(cycled_view&& that);
    
    cycled_view(cycled_view const& that);
    
    explicit cycled_view(Rng rng);
    
    cycled_view& operator=(cycled_view&& that);
    
    cycled_view& operator=(cycled_view const& that);
};

@{

Constructor ranges::v3::cycled_view<Rng>::cycled_view

explicit cycled_view(Rng rng);

<tt>distance(rng) != 0</tt><tt>distance(rng) != 0</tt>