not empty. Provided if  [ ranges::empty ](/w/cpp/ranges/empty "cpp/ranges/empty") is applicable to it.   
(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_bool&action=edit)  
[ front  ](/w/cpp/ranges/view_interface/front "cpp/ranges/view interface/front") (C++20)  |  returns the first element in the derived view. Provided if it satisfies [ ` forward_range ` ](/w/cpp/ranges/forward_range "cpp/ranges/forward 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_front&action=edit)  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/split_view&action=edit&section=3 "Edit
section: Nested classes") ]  Nested classes

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

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

Before [ P2210R2 ](https://wg21.link/P2210R2) , ` split_view ` used a _lazy_
mechanism for splitting, and thus could not keep the bidirectional, random
access, or contiguous properties of the underlying view, or make the iterator
type of the inner range same as that of the underlying view. Consequently, it
is redesigned by [ P2210R2 ](https://wg21.link/P2210R2) , and the lazy
mechanism is moved to [ ` lazy_split_view ` ](/w/cpp/ranges/lazy_split_view
"cpp/ranges/lazy split view") .

The delimiter ` pattern ` generally should not be an ordinary string literal,
as it will consider the null terminator to be necessary part of the delimiter;
therefore, it is advisable to use a  [ std::string_view
](/w/cpp/string/basic_string_view "cpp/string/basic string view") literal
instead.

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

Run this code

    
    
    #include <iomanip>
    #include <iostream>
    #include <ranges>
    #include <string_view>
     
    int main()
    {
        using std::operator""sv;
        constexpr auto words{"Hello^_^C++^_^20^_^!"sv};
        constexpr auto delim{"^_^"sv};
     
        for (const auto word : std::views::split(words, delim))
            // with string_view's C++23 range constructor:
            [std::cout](http://en.cppreference.com/w/cpp/io/cout) << [std::quoted](http://en.cppreference.com/w/cpp/io/manip/quoted)([std::string_view](http://en.cppreference.com/w/cpp/string/basic_string_view)(word)) << ' ';
        [std::cout](http://en.cppreference.com/w/cpp/io/cout) << '\n';
    }

Output:

    
    
    "Hello" "C++" "20" "!"

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/split_view&action=edit&section=7 "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   
---|---|---|---  
[ P2210R2 ](https://wg21.link/P2210R2) |  C++20  |  the old ` split_view ` was too lazy to be easily used  |  it is redesigned   
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/split_view&action=edit&section=8 "Edit
section: See also") ]  See also

[ ranges::lazy_split_view  views::lazy_split  ](/w/cpp/ranges/lazy_split_view "cpp/ranges/lazy split view") (C++20)  |  a [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") over the subranges obtained from spl