table of contents
- Tumbleweed 2026.11.13-1.1
- Leap-16.0
- Leap-15.6
| std::ranges::drop_view::base(3) | C++ Standard Libary | std::ranges::drop_view::base(3) |
NAME¶
std::ranges::drop_view::base - std::ranges::drop_view::base
Synopsis¶
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 base_. 2) Move constructs the result from the underlying view base_.
Parameters¶
(none)
Return value¶
A copy of the underlying (adapted) view base_.
Example¶
// Run this code
#include <iostream> #include <ranges>
namespace stq { void println(auto, const auto& v) {
for (const auto& e : v)
std::cout << e << ' ';
std::cout << '\n'; } }
int main() {
static constexpr int a[]{1, 2, 3, 4, 5};
constexpr auto view = a | std::views::drop(2);
stq::println("{}", view);
const auto base = view.base();
stq::println("{}", base); }
Output:¶
3 4 5 1 2 3 4 5
| 2026.11.10 | http://cppreference.com |