std::flat_multimap::size(3)
π 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
- 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