std::ranges...k_view::base(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

std::ranges...k_view::base(3) πŸ’…

okay so this page is from the C++ Standard Libary (yes, that spelling is literally in the source, bestie, don't come for me) and it's all about std::ranges::chunk_view::base. The title up top is truncated with ... β€” that's just how it's printed, no cap. ✨

🌸 NAME 🌸

std::ranges::chunk_view::base β€” std::ranges::chunk_view::base

✨ Synopsis ✨

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

It returns a copy of the underlying view. πŸ’–

Let base_ be the underlying view.

  1. Copy constructs the result from the underlying view. Equivalent to return base_;
  2. Move constructs the result from the underlying view. Equivalent to return std::move(base_);

πŸŽ€ Parameters πŸŽ€

(none)

πŸ’– Return value πŸ’–

A copy of the underlying view. That's the whole vibe. 🫢

πŸ¦‹ Example πŸ¦‹

A link to test the example online: Compiler Explorer.

// Run this code

#include <print>
#include <ranges>

int main()
{
    static constexpr auto v = {1, 2, 3, 4};
    constexpr auto w{std::ranges::chunk_view(v, 2)};
    std::println("{}", w.base());
}

πŸ”₯ Output πŸ”₯

[1, 2, 3, 4]

πŸ’– that's the whole thing, fr fr. source/version/date, for the record: http://cppreference.com, 2024.06.10, page std::ranges...k_view::base(3) 🫢✨

πŸ“¦ where this page comes from