| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
constexpr V base()const& requiresstd::copy_constructible<V>; | (1) | (since C++20) |
constexpr V base()&&; | (2) | (since C++20) |
Returns a copy of the underlying viewbase_.
Contents |
#include <iomanip>#include <iostream>#include <ranges>#include <string_view> int main(){constexprstd::string_view keywords{"this throw true try typedef typeid"}; std::ranges::split_view split_view{keywords,' '};std::cout<<"base() = "<<std::quoted(split_view.base())<<"\n""substrings: ";for(auto split: split_view)std::cout<<std::quoted(std::string_view{split})<<' ';std::cout<<'\n';}
Output:
base() = "this throw true try typedef typeid"substrings: "this" "throw" "true" "try" "typedef" "typeid"
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3590 | C++20 | theconst& overload additionally required validity of copy-assignment | constraints relaxed |
| returns a copy of the underlying (adapted) view (public member function of std::ranges::lazy_split_view<V,Pattern>)[edit] |