std::insert...:operator++(3)
π 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
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms