Header file range/v3/view/bounded.hpp

#include <range/v3/begin_end.hpp>

#include <range/v3/iterator_range.hpp>

#include <range/v3/range_concepts.hpp>

#include <range/v3/range_fwd.hpp>

#include <range/v3/range_traits.hpp>

#include <range/v3/size.hpp>

#include <range/v3/view_interface.hpp>

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

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

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

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

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

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

namespace ranges
{
    inline namespace v3
    {
        template <typename Rng>
        struct bounded_view
        : view_interface<bounded_view<Rng>, range_cardinality<Rng>::value>
        {
            using iterator = meta::if_<RA_and_Sized, base_iterator_t, common_iterator<base_iterator_t, base_sentinel_t>>;
            
            bounded_view() = default;
            
            explicit bounded_view(Rng rng);
            
            iterator begin();
            
            iterator end();
            
            template <int _concept_requires_74 = 42, typename std::enable_if<(_concept_requires_74==43)||(SizedRange<Rng>()), int>::type=0>
            range_size_t<Rng> size();
            
            template <int _concept_requires_79 = 42, typename std::enable_if<(_concept_requires_79==43)||(View<Rng const>()), int>::type=0>
            iterator begin() const;
            
            template <int _concept_requires_84 = 42, typename std::enable_if<(_concept_requires_84==43)||(View<Rng const>()), int>::type=0>
            iterator end() const;
            
            template <int _concept_requires_89 = 42, typename std::enable_if<(_concept_requires_89==43)||(SizedRange<Rng const>()), int>::type=0>
            range_size_t<Rng> size() const;
            
            Rng& base();
            
            Rng const& base() const;
        };
        
        namespace view
        {
            struct bounded_fn
            {
                template <typename Rng, int _concept_requires_109 = 42, typename std::enable_if<(_concept_requires_109==43)||(Range<Rng>()&&!BoundedRange<Rng>()), int>::type=0>
                bounded_view<all_t<Rng>> operator()(Rng&& rng) const;
                
                template <typename Rng, int _concept_requires_115 = 42, typename std::enable_if<(_concept_requires_115==43)||(Range<Rng>()&&BoundedRange<Rng>()), int>::type=0>
                all_t<Rng> operator()(Rng&& rng) const;
                
                template <typename Rng, int _concept_requires_122 = 42, typename std::enable_if<(_concept_requires_122==43)||(!Range<Rng>()), int>::type=0>
                void operator()(Rng&&) const;
            };
            
            inline namespace 
            {
                constexpr auto& bounded = static_const<view<bounded_fn>>::value;
            }
            
            template <typename Rng>
            using bounded_t = decltype(bounded(std::declval<Rng>()));
        }
    }
}