iter_move(s...t_iterator)(3)

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

πŸ’– NAME πŸ’–

okay so bestie, welcome to the iter_move(s...t_iterator)(3) page from the C++ Standard Libary manual β€” yes, that's the manual name exactly, typo and all, and we are respecting it. πŸŽ€

The NAME line is literally: iter_move(std::basic_const_iterator) - iter_move(std::basic_const_iterator). It's giving self-referential icon behavior, and honestly? Obsessed.

✨ Synopsis ✨

The signature is a friend constexpr moment, with a noexcept situation and a β€œsince C++23” note tucked in the comment. Here it is exactly:

friend constexpr /*rvalue-reference*/
    iter_move( const basic_const_iterator& i ) noexcept(/* see below
(since C++23)
*/);

What it does: it casts the result of dereferencing the underlying iterator to its associated const rvalue reference type. Lowkey elegant.

The return type /*rvalue-reference*/ is:

std::common_reference_t<const std::iter_value_t<Iter>&&, std::iter_rvalue_reference_t<Iter>>

The function body is equivalent to: return static_cast</*rvalue-reference*/>(std::ranges::iter_move(i.base()));.

Big important vibe check: this function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::basic_const_iterator<Iter> is an associated class of the arguments. So no ordinary lookup hunting, bestie β€” ADL has to be the one to find it. πŸ‘‘

🌸 Return value 🌸

An rvalue reference to const, or a prvalue. That's the whole return-value tea. β˜•

πŸ’… Exceptions πŸ’…

The noexcept specification is exactly:

noexcept(noexcept(static_cast</*rvalue-reference*/>(std::ranges::iter_move(i.base()))))

πŸ¦‹ Example πŸ¦‹

This section is incomplete. Reason: no example.

No example, bestie 😭. The manual is literally serving β€œincomplete” with β€œno example” as the reason, and we are not inventing one. Periodt.

πŸ‘‘ See also πŸ‘‘

iter_move casts the result of dereferencing an object to its associated rvalue reference type β€” with the manual's (C++20) marker and the (customization point object) label. So yes, customization-point-object energy.

🌈 Categories 🌈

  • conditionally noexcept
  • Todo no example

signed off with love from http://cppreference.com, version/date 2024.06.10. Mwah πŸ’–

πŸ“¦ where this page comes from