Header file range/v3/utility/memory.hpp

#include <range/v3/range_fwd.hpp>

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

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

namespace ranges
{
    inline namespace v3
    {
        namespace detail
        {
            template <typename I>
            struct external_count
            {
                external_count() = default;
                
                external_count(I& i);
                
                external_count& operator--();
                
                void operator--(int);
            };
            
            template <typename T, bool B = std::is_trivially_destructible<T>::value>
            struct destroy_n
            {
                void operator()(T const*) const noexcept;
                
                destroy_n& operator++();
                
                void operator++(int);
            };
            
            template <typename T>
            struct destroy_n<T, false>
            {
                destroy_n() = default;
                
                void operator()(T const* p) noexcept;
                
                destroy_n& operator++();
                
                void operator++(int);
            };
            
            struct return_temporary_buffer
            {
                template <typename T>
                void operator()(T* p) const;
            };
        }
        
        template <typename O, typename Val>
        struct raw_storage_iterator;
        
        template <typename V, typename I, typename D>
        counted_iterator<raw_storage_iterator<I, V>, detail::external_count<D>> make_counted_raw_storage_iterator(I i, D& d);
        
        template <typename I, typename D, typename V = iterator_value_t<I>>
        counted_iterator<raw_storage_iterator<I, V>, detail::external_count<D>> make_counted_raw_storage_iterator(I i, D& d);
    }
}

Class template ranges::v3::raw_storage_iterator<O, Val>

template <typename O, typename Val>
struct raw_storage_iterator
{
    using difference_type = iterator_difference_t<O>;
    
    raw_storage_iterator() = default;
    
    explicit raw_storage_iterator(O out);
    
    raw_storage_iterator const& operator*() const;
    
    template <int _concept_requires_125 = 42, typename std::enable_if<(_concept_requires_125==43)||(CopyConstructible<Val>()), int>::type=0>
    raw_storage_iterator const& operator=(Val const& val) const;
    
    template <int _concept_requires_131 = 42, typename std::enable_if<(_concept_requires_131==43)||(MoveConstructible<Val>()), int>::type=0>
    raw_storage_iterator const& operator=(Val&& val) const;
    
    raw_storage_iterator& operator++();
    
    raw_storage_iterator operator++(int);
    
    O base() const;
};

@{