std::ranges...::operator*(3)

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

πŸ’… std::ranges::transform_view::iterator::operator* πŸ’…

okay bestie, welcome to the C++ Standard Libary manual, page std::ranges...::operator*(3) β€” yes, that's the manual name folded in near the top instead of doing the whole header-line copy-paste thing. This one is so niche and so C++20. πŸ¦‹

✨ NAME ✨

std::ranges::transform_view::iterator::operator* - std::ranges::transform_view::iterator::operator*

🌸 SYNOPSIS 🌸

constexpr decltype(auto) operator*() const;  (since C++20)

Returns the transformed element. periodt. ✨

Effectively returns std::invoke(*parent_->fun_, *current_), where *parent_->fun_ is the transformation function stored in the parent transform_view, and current_ is the underlying iterator into V.

πŸŽ€ PARAMETERS πŸŽ€

(none) β€” literally zero parameters, bestie. 🫢

πŸ’– RETURN VALUE πŸ’–

The transformed element. That's the whole vibe. πŸ‘‘

πŸ”₯ NOTES πŸ”₯

  • operator-> is not provided. Not me looking for it πŸ™ˆ
  • The behavior is undefined if the pointer to parent transform_view is null (e.g. if *this is default constructed).
  • If *current_ is a prvalue, its lifetime ends before this function returns. If the transformation function returns a reference or pointer to it, the result would dangle. πŸ’€
undefined behavior alert: that's the scary one, no cap. 😭

πŸ¦‹ EXAMPLE πŸ¦‹

This section is incomplete. 😭

Reason: no example.

πŸ“ CATEGORY πŸ“

  • Todo no example

πŸ’Œ source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::ranges...::operator*(3) β€” bye bestie, go transform something cute πŸŒˆπŸ’œ

πŸ“¦ where this page comes from