std::flat_multimap::size(3)

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

πŸ’– NAME πŸ’–

std::flat_multimap::size - std::flat_multimap::size

Okay bestie, welcome to the std::flat_multimap::size(3) page from the C++ Standard Libary manual. This is lowkey the size page, and ngl it is giving main character energy: β€œhow many elements are in this container adaptor?” πŸ’…

✨ Synopsis ✨

size_type size() const noexcept;  (since C++23)

It returns the number of elements in the container adaptor. Equivalent to return c.keys.size(). β€” that's the whole vibe, no cap. 🫢

πŸŽ€ Parameters πŸŽ€

(none) β€” literally no parameters. Zero. Nada. Not a single argument, bestie. Not me being obsessed with a (none) section, honestly. πŸŽ€

🌸 Return value 🌸

The number of elements in the container adaptor. That's it. That's the tea. Highkey iconic. 🌸

πŸ¦‹ Complexity πŸ¦‹

Vibe check: Constant. Fr fr. πŸ¦‹

πŸ’… Example πŸ’…

The following code uses size to display the number of elements in a std::flat_multimap:

// Run this code

#include <iostream>
#include <flat_map>

int main()
{
    std::flat_multimap<int,char> nums{{1, 'a'}, {3, 'b'}, {5, 'c'}, {7,
'd'}};

    std::cout << "nums contains " << nums.size() << " elements.\n";
}

πŸ“ Output πŸ“

nums contains 4 elements.

πŸ‘‘ See also πŸ‘‘

  • empty β€” checks whether the container adaptor is empty (public member function)
  • size (C++17) β€” returns the size of a container or array (function template)
  • ssize (C++20) β€” returns the size of a container or array (function template)
  • max_size β€” returns the maximum possible number of elements (public member function)

iykyk, that's the whole see-also situation. Source/version: http://cppreference.com, date: 2024.06.10 β€” mwah πŸ’‹, go slay your build, bestie! πŸ’–

πŸ“¦ where this page comes from