std::forwar...place_front(3)

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

πŸ’… NAME πŸ’…

okay so bestie, welcome to the std::forwar...place_front(3) page from the C++ Standard Libary β€” yes, that's the manual name, and yes, β€œLibary” is literally what the header says, not me being chaotic πŸ™ˆ.

std::forward_list::emplace_front β€” literally std::forward_list::emplace_front. That's the name, that's the vibe, we move. πŸ’–

🌸 Synopsis 🌸

template< class... Args >                   (since C++11)
void emplace_front( Args&&... args );       (until C++17)
template< class... Args >                   (since C++17)
reference emplace_front( Args&&... args );

Inserts a new element to the beginning of the container. The element is constructed through std::allocator_traits::construct, which typically uses placement-new to construct the element in-place at the location provided by the container. The arguments args... are forwarded to the constructor as std::forward<Args>(args)....

No iterators or references are invalidated. No cap. ✨

πŸŽ€ Parameters πŸŽ€

  • args β€” arguments to forward to the constructor of the element.

🧚 Type requirements 🧚

  • T (the container's element type) must meet the requirements of EmplaceConstructible.

⭐ Return value ⭐

  • (none) β€” until C++17
  • A reference to the inserted element. β€” since C++17

πŸ”₯ Complexity πŸ”₯

Constant.

πŸ’€ Exceptions πŸ’€

If an exception is thrown for any reason, this function has no effect (strong exception safety guarantee). Like, it's giving β€œwhat happens in this call stays in this call” β€” no changes left behind, periodt. 🫢

πŸ‘‘ See also πŸ‘‘

  • push_front β€” inserts an element to the beginning (public member function).

okay bye bestie 🫢 this page is from http://cppreference.com, dated 2024.06.10, and it's the std::forwar...place_front(3) manual page β€” slay πŸ’…βœ¨

πŸ“¦ where this page comes from