Header file range/v3/view/take_exactly.hpp

#include <range/v3/range_fwd.hpp>

#include <range/v3/range_traits.hpp>

#include <range/v3/range_concepts.hpp>

#include <range/v3/view_interface.hpp>

#include <range/v3/iterator_range.hpp>

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

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

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

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

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

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

namespace ranges
{
    inline namespace v3
    {
        namespace detail
        {
            template <typename Rng>
            struct is_random_access_bounded_
            : meta::bool_<(_Bool)RandomAccessRange<Rng>() && (_Bool)BoundedRange<Rng>()>
            {};
            
            template <typename Rng, bool IsRandomAccessBounded>
            struct take_exactly_view_
            : view_facade<take_exactly_view_<Rng, IsRandomAccessBounded>, finite>
            {
                take_exactly_view_() = default;
                
                take_exactly_view_(Rng rng, difference_type_ n);
                
                range_size_t<Rng> size() const;
                
                Rng& base();
                
                Rng const& base() const;
            };
            
            template <typename Rng>
            struct take_exactly_view_<Rng, true>
            : view_interface<take_exactly_view_<Rng, true>, finite>
            {
                take_exactly_view_() = default;
                
                take_exactly_view_(Rng rng, difference_type_ n);
                
                range_iterator_t<Rng> begin();
                
                range_iterator_t<Rng> end();
                
                template <typename BaseRng = Rng, int _concept_requires_110 = 42, typename std::enable_if<(_concept_requires_110==43)||(Range<BaseRng const>()), int>::type=0>
                range_iterator_t<BaseRng const> begin() const;
                
                template <typename BaseRng = Rng, int _concept_requires_116 = 42, typename std::enable_if<(_concept_requires_116==43)||(Range<BaseRng const>()), int>::type=0>
                range_iterator_t<BaseRng const> end() const;
                
                range_size_t<Rng> size() const;
                
                Rng& base();
                
                Rng const& base() const;
            };
        }
        
        namespace view
        {
            struct take_exactly_fn
            {
                template <typename Rng, int _concept_requires_183 = 42, typename std::enable_if<(_concept_requires_183==43)||(InputRange<Rng>()), int>::type=0>
                decltype(take_exactly_fn::invoke_(std::forward<Rng>(rng), n, range_concept<Rng>{})) operator()(Rng&& rng, range_difference_t<Rng> n) const;
                
                template <typename Rng, typename T, int _concept_requires_192 = 42, typename std::enable_if<(_concept_requires_192==43)||(!InputRange<Rng>()), int>::type=0>
                void operator()(Rng&&, T&&) const;
            };
            
            inline namespace 
            {
                constexpr auto& take_exactly = static_const<view<take_exactly_fn>>::value;
            }
        }
    }
}