std::unorde...size_type),(3)

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

πŸ’… std::unordered_multiset::end(size_type) πŸ’…

okay so this is from the C++ Standard Libary manual, and the header up top is that iconic truncated std::unorde...size_type),(3) situation 😭. Today’s main character is std::unordered_multiset::end(size_type), and bestie, there are multiple flavors. 🫢


✨ NAME ✨

  • std::unordered_multiset::end(size_type), -
  • std::unordered_multiset::end(size_type),

🌸 Synopsis 🌸

three overloads, all since C++11, all iconic:

local_iterator end( size_type n );               (since C++11)
const_local_iterator end( size_type n ) const;   (since C++11)
const_local_iterator cend( size_type n ) const;  (since C++11)

okay so what it does: it returns an iterator to the element following the last element of the bucket with index n. This element acts as a placeholder, and attempting to access it results in undefined behavior. 🫠 like, do not touch the placeholder β€” undefined behavior is not a cute look.


πŸŽ€ Parameters πŸŽ€

  • n β€” the index of the bucket to access.

πŸ¦‹ Return value πŸ¦‹

An iterator to the element following the last element. that’s the whole return value, no cap. ✨


🌈 Complexity 🌈

Constant. literally constant, bestie β€” no scaling drama. πŸ’…


πŸ’œ See also πŸ’œ

  • begin(size_type) β€” returns an iterator to the beginning of the specified bucket.
  • cbegin(size_type) β€” (public member function).

mwah πŸ’‹ β€” source/version: http://cppreference.com, date: 2024.06.10. πŸŽ€

πŸ“¦ where this page comes from