std::insert...ert_iterator(3)
πΈ NAME πΈ
std::insert_iterator::insert_iterator β bestie, it's the std::insert_iterator::insert_iterator member, and yes the name really does repeat itself like that. Main character energy π
β¨
π Synopsis π
This is from the C++ Standard Libary manual (that spelling is literally in the source, no cap π).
Until C++20, the signature is giving:
insert_iterator( Container& c, typename Container::iterator i );
(until C++20)
Since C++20, it's serving constexpr:
constexpr insert_iterator( Container& c,
ranges::iterator_t<Container> i );
(since C++20)
Lowkey the important bit: it initializes the underlying pointer to the container to std::addressof(c) and the underlying iterator to i π«Άβ¨
π Parameters π
cβ container to initialize the inserter with πiβ iterator to initialize the inserter with πΈ
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. Retroactive glow-ups, we love to see it ππ
LWG 561β applied toC++98. Behavior as published: the type ofiwas independent ofContainer. Correct behavior: it is the iterator type ofContainerβ¨P2325R3β applied toC++20. Behavior as published:default constructor was provided as along with the iterators must be default_initializable requirement. Correct behavior:C++20 removed the requirementπ
Okay that's the whole page, bestie π«Ά Source/version: http://cppreference.com; date: 2024.06.10; page: std::insert...ert_iterator(3). Slay and stay constexpr β¨π
π¦ 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