Header file range/v3/view/sample.hpp

#include <meta/meta.hpp>

#include <range/v3/range_concepts.hpp>

#include <range/v3/view_facade.hpp>

#include <range/v3/algorithm/shuffle.hpp>

#include <range/v3/utility/compressed_pair.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
    {
        namespace detail
        {
            template <typename Rng, bool=SizedSentinel<range_sentinel_t<Rng>, range_iterator_t<Rng>>::value>
            class size_tracker
            {
            public:
                size_tracker() = default;
                
                size_tracker(Rng& rng);
                
                void decrement();
                
                range_difference_t<Rng> get(Rng&, range_iterator_t<Rng>&) const;
            };
            
            template <typename Rng>
            class size_tracker<Rng, true>
            {
            public:
                size_tracker() = default;
                
                size_tracker(Rng&);
                
                void decrement();
                
                range_difference_t<Rng> get(Rng& rng, range_iterator_t<Rng>const& it) const;
            };
        }
        
        template <typename Rng, typename URNG>
        class sample_view
        : public view_facade<sample_view<Rng, URNG>, finite>
        {
        public:
            sample_view() = default;
            
            explicit sample_view(Rng rng, D sample_size, URNG& generator);
        };
        
        namespace view
        {
            class sample_fn
            {
            public:
                template <typename Rng, typename URNG = detail::default_random_engine, int _concept_requires_207 = 42, typename std::enable_if<(_concept_requires_207==43)||(Constraint<Rng, URNG>()), int>::type=0>
                sample_view<all_t<Rng>, URNG> operator()(Rng&& rng, range_difference_t<Rng> sample_size, URNG& generator = detail::get_random_engine()) const;
                
                template <typename Rng, typename URNG = detail::default_random_engine, int _concept_requires_219 = 42, typename std::enable_if<(_concept_requires_219==43)||(!Constraint<Rng, URNG>()), int>::type=0>
                void operator()(Rng&&, URNG&& = URNG{}) const;
            };
            
            inline namespace 
            {
                constexpr auto& sample = static_const<view<sample_fn>>::value;
            }
        }
    }
}