| ||||||||||||||||||||||
| 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_.A copy of the underlying (adapted) viewbase_.
#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::drop(2); stq::println("{}", view);constauto base= view.base(); stq::println("{}", base);}
Output:
3 4 51 2 3 4 5