ublic member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_back&action=edit)  
[ operator[]  ](/w/cpp/ranges/view_interface/operator_at "cpp/ranges/view interface/operator at") (C++20)  |  returns the n  th  element in the derived view. Provided if it satisfies [ ` random_access_range ` ](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") .   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_operator_at&action=edit)  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/subrange&action=edit&section=2 "Edit
section: Deduction guides") ]  [ Deduction guides
](/w/cpp/ranges/subrange/deduction_guides "cpp/ranges/subrange/deduction
guides")

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/subrange&action=edit&section=3 "Edit
section: Non-member functions") ]  Non-member functions

[ get  (std::ranges::subrange)  ](/w/cpp/ranges/subrange/get "cpp/ranges/subrange/get") (C++20)  |  obtains iterator or sentinel from a  **std::ranges::subrange**   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/subrange/dsc_get&action=edit)  
---|---  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/subrange&action=edit&section=4 "Edit
section: Helper types") ]  Helper types

[ ranges::subrange_kind  ](/w/cpp/ranges/subrange_kind "cpp/ranges/subrange kind") (C++20)  |  specifies whether a  **std::ranges::subrange** models  [ std::ranges::sized_range ](/w/cpp/ranges/sized_range "cpp/ranges/sized range")   
(enum)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_subrange_kind&action=edit)  
---|---  
[ std::tuple_size  <std::ranges::subrange> ](/w/cpp/ranges/subrange/tuple_size "cpp/ranges/subrange/tuple size") (C++20)  |  obtains the number of components of a  **std::ranges::subrange**   
(class template specialization)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/subrange/dsc_tuple_size&action=edit)  
[ std::tuple_element  <std::ranges::subrange> ](/w/cpp/ranges/subrange/tuple_element "cpp/ranges/subrange/tuple element") (C++20)  |  obtains the type of the iterator or the sentinel of a  **std::ranges::subrange**   
(class template specialization)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/subrange/dsc_tuple_element&action=edit)  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/subrange&action=edit&section=5 "Edit
section: Helper templates") ]  Helper templates

template  < class  I,  class  S, [ ranges::  subrange_kind
](http://en.cppreference.com/w/cpp/ranges/subrange_kind) K  >  
inline  constexpr  bool  enable_borrowed_range  < ranges  ::  subrange  < I, S, K  >> =  true  ;  |  |   
---|---|---  
|  |   
  
This specialization of [ ` std::ranges::enable_borrowed_range `
](/w/cpp/ranges/borrowed_range "cpp/ranges/borrowed range") makes ` subrange `
satisfy [ ` borrowed_range ` ](/w/cpp/ranges/borrowed_range
"cpp/ranges/borrowed range") .

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/subrange&action=edit&section=6 "Edit
section: Example") ]  Example

Run this code

    
    
    #include <iostream>
    #include <map>
    #include <ranges>
    #include <string_view>
     
    template<class V>
    void mutate(V& v)
    {
        v += 'A' - 'a';
    }
     
    template<class K, class V>
    void mutate_map_values([std::multimap](http://en.cppreference.com/w/cpp/container/multimap)<K, V>& m, K k)
    {
        auto [first, last] = m.equal_range(k);
        for (auto& [_, v] : std::ranges::subrange(first, last))
            mutate(v);
    }
     
    int main()
    {
        auto print = []([std::string_view](http://en.cppreference.com/w/cpp/string/basic_string_view) rem, auto const& mm)
        {
            [std::cout](http://en.cppreferen