dex.php?title=Template:cpp/ranges/view_interface/dsc_front&action=edit)  
[ back  ](/w/cpp/ranges/view_interface/back "cpp/ranges/view interface/back") (C++20)  |  returns the last element in the derived view. Provided if it satisfies [ ` bidirectional_range ` ](/w/cpp/ranges/bidirectional_range "cpp/ranges/bidirectional range") and [ ` common_range ` ](/w/cpp/ranges/common_range "cpp/ranges/common 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_back&action=edit)  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/join_view&action=edit&section=2 "Edit
section: Deduction guides") ]  [ Deduction guides
](/w/cpp/ranges/join_view/deduction_guides "cpp/ranges/join view/deduction
guides")

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/join_view&action=edit&section=3 "Edit
section: Nested classes") ]  Nested classes

[ _ iterator  _ ](/w/cpp/ranges/join_view/iterator "cpp/ranges/join view/iterator") (C++20)  |  the iterator type   
(  exposition-only member class template*  )  
---|---  
[ _ sentinel  _ ](/w/cpp/ranges/join_view/sentinel "cpp/ranges/join view/sentinel") (C++20)  |  the sentinel type   
(  exposition-only member class template*  )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/join_view&action=edit&section=4 "Edit
section: Notes") ]  Notes

Before [ P2328R1 ](https://wg21.link/P2328R1) was adopted, the inner range
type (  [ ranges::  range_reference_t
](http://en.cppreference.com/w/cpp/ranges/iterator_t) < V  > ) cannot be a
container type (but can be reference to container). For example, it was not
allowed to join a [ ` transform_view ` ](/w/cpp/ranges/transform_view
"cpp/ranges/transform view") of  [ std::string ](/w/cpp/string/basic_string
"cpp/string/basic string") prvalue.

    
    
    struct Person { int age; [std::string](http://en.cppreference.com/w/cpp/string/basic_string) name; };
     
    auto f([std::vector](http://en.cppreference.com/w/cpp/container/vector)<Person>& v) {
    //  return v | std::views::transform([](auto& p){ return p.name; })
    //           | std::views::join; // error before P2328R1
        return v | std::[views::transform](http://en.cppreference.com/w/cpp/ranges/transform_view)([](auto& p) -> [std::string](http://en.cppreference.com/w/cpp/string/basic_string)& { return p.name; })
                 | std::views::join; // OK
    }

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

Run this code

    
    
    #include <iostream>
    #include <ranges>
    #include <string_view>
    #include <vector>
     
    int main()
    {
        using namespace std::literals;
     
        const auto bits = {"https:"sv, "//"sv, "cppreference"sv, "."sv, "com"sv};
        for (char const c : bits | std::views::join)
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << c;
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
     
        const [std::vector](http://en.cppreference.com/w/cpp/container/vector)<[std::vector](http://en.cppreference.com/w/cpp/container/vector)<int>> v{{1, 2}, {3, 4, 5}, {6}, {7, 8, 9}};
        auto jv = std::ranges::join_view(v);
        for (int const e : jv)
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << e << ' ';
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
    }

Output:

    
    
    https://cppreference.com
    1 2 3 4 5 6 7 8 9

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

The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.

DR  |  Applied to  |  Behavior as published  |  Correct behavior   
---|---|---|---  
[ LWG 3474 ](https://cplusplus.github.io/LWG/issue3474) |  C++20  |  views  ::  join  (  e  )  returned a copy of  e  wh