std::insert...:operator++(3)

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

πŸ’… std::insert_iterator::operator++ πŸ’…

okay so bestie, welcome to the std::insert...:operator++(3) page from the C++ Standard Libary manual β€” yes, that's the exact manual name, typo and all, don't come for me 😭. This is the tiny little operator page that's basically the backstage pass for insert iterators. It looks boring, but it's lowkey doing important contract work. ✨


πŸ‘‘ NAME πŸ‘‘

std::insert_iterator::operator++ - std::insert_iterator::operator++. That's it. That's the name. It's giving "I have one job and the job is my name" energy πŸ’€.

✨ Synopsis ✨

here's the whole cast, and yes we're keeping the C++20 glow-up tags exactly:

insert_iterator& operator++();                 (until C++20)
constexpr insert_iterator& operator++();       (since C++20)
insert_iterator& operator++( int );            (until C++20)
constexpr insert_iterator& operator++( int );  (since C++20)

So there are two shapes: one with no argument and one that takes an int. The first pair is insert_iterator& operator++(); until C++20, then constexpr insert_iterator& operator++(); since C++20. The second pair is insert_iterator& operator++( int ); until C++20, then constexpr insert_iterator& operator++( int ); since C++20. πŸŽ€

Does nothing. Yup, fr fr β€” these operator overloads are provided to satisfy the requirements of LegacyOutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying container. That's the whole plot. No secret side quest. πŸ¦‹

lowkey iconic: an operator that does nothing but still has to exist so the iterator plays nice with LegacyOutputIterator. no cap, that's the vibe. πŸ’…

πŸŽ€ Parameters πŸŽ€

  • (none) β€” literally no parameters, bestie. zero. nada. the void has entered the chat 🫢.

πŸ’– Return value πŸ’–

  • *this β€” it returns *this, which is main character energy in its purest form: it just hands you back itself πŸ‘‘.

that's the whole page, bestie β€” short, sweet, and contract-compliant. signed with love by source/version http://cppreference.com, dated 2024.06.10 πŸŒˆπŸ’–

πŸ“¦ where this page comes from