std::ranges...:common_view(3)

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

πŸ’– std::ranges::common_view::common_view πŸ’–

okay bestie, welcome to the std::ranges...:common_view(3) page from the C++ Standard Libary manual (their spelling, not mine 😭). This is the vibe check for the common_view::common_view constructor. ✨


🌸 NAME 🌸

std::ranges::common_view::common_view β€” that's the name, and the original NAME line says std::ranges::common_view::common_view twice, so we're keeping both: std::ranges::common_view::common_view and std::ranges::common_view::common_view. Iconic repetition, no notes. πŸ’…

✨ Synopsis ✨

common_view() = default;               (1) (since C++20)
constexpr explicit common_view( V r ); (2) (since C++20)

Constructs a common_view. Periodt. πŸ’–

  1. Default constructor. Value-initializes the underlying view. After construction, base() returns a copy of V(). So slay, it's all clean and default-y. ✨
  2. This one takes r. Initializes the underlying view with std::move(r). Moving? We love to see it. 🫢

🌸 Parameters 🌸

  • r β€” underlying view to be adapted into a common-range. That's the whole parameter list, bestie.

πŸŽ€ Example πŸŽ€

This section is incomplete Reason: no example

Not me reading a whole Example section just to find out there's no example 😭. That's literally what it says, so that's what you get.

πŸ¦‹ Defect reports πŸ¦‹

The following behavior-changing defect reports were applied retroactively to previously published C++ standards. Yes, retroactively β€” the lore goes back. πŸ‘‘

  • DR LWG 3405 Β· applied to C++20
    • Behavior as published: the redundant converting constructor might cause constraint recursion
    • Correct behavior: removed

⭐ Category ⭐

  • Todo no example

source/version: http://cppreference.com Β· date: 2024.06.10 β€” that's the tea, bestie, mwah πŸ’‹
πŸ“¦ where this page comes from