std::basic_...nt-iterator(3)

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

πŸ’– NAME πŸ’–

  • std::basic_const_iterator::operatorconstant-iterator
  • std::basic_const_iterator::operatorconstant-iterator

Okay so bestie, welcome to the std::basic_...nt-iterator(3) page. Manual name: C++ Standard Libary β€” yes, that's the spelling on the page, and we're not fixing it, periodt. πŸ’… This whole thing is giving conversion-operator main character energy, and we're gonna keep every detail. ✨


🌸 Synopsis 🌸

          template< /*not-a-const-iterator*/ CI >

            requires /*constant-iterator*/<CI> &&    (1) (since C++23)
                std::convertible_to<Iter const&, CI>

          constexpr operator CI() const &;
          template< /*not-a-const-iterator*/ CI >

            requires /*constant-iterator*/<CI> &&    (2) (since C++23)
                std::convertible_to<Iter, CI>

          constexpr operator CI() &&;

Returns the converted constant iterator to which an underlying iterator current can be explicitly or implicitly convertible. No cap, that's the whole vibe. πŸ¦‹

CI satisfies the exposition-only concept /*not-a-const-iterator*/ if and only if it's not a specialization of basic_const_iterator. Periodt. πŸ’œ


πŸŽ€ Return value πŸŽ€

  1. current
  2. std::move(current)

Short, sweet, iconic. πŸ‘‘


πŸ¦‹ Example πŸ¦‹

This section is incomplete. Reason: no example.

Not me staring at an empty example section, but okay, we move. 😭


πŸ”₯ Defect reports πŸ”₯

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR: P2836R1
  • Applied to: C++23
  • Behavior as published: basic_const_iterator doesn't follow its underlying type's convertibility
  • Correct behavior: provided

History? Applied retroactively? We love a glow-up. ✨


πŸ’… Category πŸ’…

  • Todo no example

Bestie, that's the whole page, every detail intact, no skips, no cap. 🫢


mwah πŸ’‹ β€” source/version: http://cppreference.com, 2024.06.10. Go slay those conversions, bestie. πŸŒˆπŸ’–

πŸ“¦ where this page comes from