GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::ranges::drop_while_view::base(3) C++ Standard Libary std::ranges::drop_while_view::base(3)

std::ranges::drop_while_view::base - std::ranges::drop_while_view::base


constexpr V base() const& requires std::copy_constructible<V>; (1) (since C++20)
constexpr V base() &&; (2) (since C++20)


Returns a copy of the underlying view.


1) Copy constructs the result from the underlying view.
2) Move constructs the result from the underlying view.


(none)


A copy of the underlying view.

// Run this code


#include <array>
#include <ranges>
#include <iostream>
#include <algorithm>


void print(auto first, auto last) {
for (; first != last; ++first)
std::cout << *first << ' ';
std::cout << '\n';
}


int main()
{
std::array data{ 1, 2, 3, 4, 5 };
print(data.cbegin(), data.cend());


auto func = [](int x) { return x < 3; };
auto view = std::ranges::drop_while_view{ data, func };
print(view.begin(), view.end());


auto base = view.base(); // `base` refers to the `data`
std::ranges::reverse(base); //< changes `data` indirectly
print(data.cbegin(), data.cend());
}


1 2 3 4 5
3 4 5
5 4 3 2 1

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.