std::multis...emplace_hint(3)

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

πŸ’– NAME πŸ’–

okay so bestie, this is the manual page for std::multiset::emplace_hint β€” and yes, the name repeats: std::multiset::emplace_hint - std::multiset::emplace_hint. It lives in the C++ Standard Libary (that spelling is straight from the header, no cap πŸ’…).

πŸ“ Synopsis πŸ“

template< class... Args >                                      (since C++11)
iterator emplace_hint( const_iterator hint, Args&&... args );

Inserts a new element into the container as close as possible to the position just before hint. 🫢

The constructors of the key and mapped value are called with exactly the same arguments as supplied to the function, forwarded with std::forward<Args>(args)....

No iterators or references are invalidated. Not a one. ✨

🎯 Parameters 🎯

  • hint β€” iterator to the position before which the new element will be inserted.
  • args β€” arguments to forward to the constructor of the element.

πŸ” Return value πŸ”

An iterator to the inserted element. Slay. πŸ’…

🚨 Exceptions 🚨

If an exception is thrown for any reason, this function has no effect (strong exception safety guarantee). So like, it's giving strong safety, bestie. πŸ›‘οΈ

⏱️ Complexity ⏱️

Logarithmic in the size of the container in general, but amortized constant if the new element is inserted just before hint. πŸ”₯

πŸ§ͺ Example πŸ§ͺ

This section is incomplete. Reason: no example. 😭 (tragic, I know)

πŸ‘€ See also πŸ‘€

  • emplace β€” constructs element in-place (C++11) (public member function).
  • insert β€” inserts elements or nodes (since C++17) (public member function).

πŸ—‚οΈ Category πŸ—‚οΈ

  • Todo no example.

mwah πŸ’‹ β€” this page is from http://cppreference.com, dated 2024.06.10, and filed under std::multis...emplace_hint(3). πŸŽ€

πŸ“¦ where this page comes from