| ||||||||||||||||||||||
| 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 view.
base_.base_.Contents |
(none)
A copy of the underlying view.
#include <iostream>#include <ranges> namespace stq{void println(auto,constauto& v){for(constauto& e: v)std::cout<< e<<' ';std::cout<<'\n';}} int main(){staticconstexprint a[]{1,2,3,4,5};constexprauto view= a| std::views::take_while([](int x){return x<4;}); stq::println("{}", view);constauto base= view.base(); stq::println("{}", base);}
Output:
1 2 31 2 3 4 5
| returns a reference to the stored predicate (public member function)[edit] |