Header file range/v3/utility/counted_iterator.hpp

#include <meta/meta.hpp>

#include <range/v3/range_fwd.hpp>

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

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

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

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

namespace ranges
{
    inline namespace v3
    {
        namespace detail
        {
            template <typename A, typename B>
            using UnambiguouslyConvertible = meta::or_c<(bool)Same<A, B>(), ConvertibleTo<A, B>()==!ConvertibleTo<B, A>()>;
            
            template <typename A, typename B>
            using UnambiguouslyConvertibleType = meta::_t<meta::if_c<(bool)Same<A, B>(), meta::id<A>, meta::if_c<ConvertibleTo<A, B>()&&!ConvertibleTo<B, A>(), meta::id<A>, meta::if_c<ConvertibleTo<B, A>()&&!ConvertibleTo<A, B>(), meta::id<B>, meta::nil_>>>>;
            
            template <typename I, bool IsReadable = (bool)Readable<I>()>
            struct counted_cursor_types{};
            
            template <typename I>
            struct counted_cursor_types<I, true>
            {
                using single_pass = SinglePass<I>;
                
                using value_type = iterator_value_t<I>;
            };
            
            template <typename I, typename D>
            struct counted_cursor
            {
                counted_cursor();
                
                counted_cursor(I it, D n);
                
                template <typename OtherI, typename OtherD, int _concept_requires_172 = 42, typename std::enable_if<(_concept_requires_172==43)||(ConvertibleTo<OtherI, I>()&&ConvertibleTo<OtherD, D>()), int>::type=0>
                counted_cursor(counted_cursor<OtherI, OtherD> that);
                
                I base() const;
                
                D count() const;
            };
        }
        
        template <typename I, int _concept_requires_191 = 42, typename std::enable_if<(_concept_requires_191==43)||(Iterator<I>()), int>::type=0>
        counted_iterator<I> make_counted_iterator(I i, iterator_difference_t<I> n);
    }
}