std::multiset::size(3)
π NAME π
Okay so this is std::multiset::size(3), folded in from the C++ Standard Libary manual β yes bestie, that's the manual name right there, typo and all π.
The NAME section is literally:
std::multiset::size - std::multiset::size
No cap, that's what it says. Moving on, because the rest is where the actual tea is ββ¨.
π¦ Synopsis π¦
Here's the signature, exactly:
size_type size() const; (noexcept since C++11)
It returns the number of elements in the container, i.e. std::distance(begin(), end()). That's the whole vibe: it tells you how many things are in there π
.
π«Ά Parameters π«Ά
(none) β literally none, bestie. It takes no arguments. Zero. Nada. The audacity, honestly π.
π Return value π
The number of elements in the container. That's it. That's the answer. Iconic behavior π.
β‘ Complexity β‘
Constant. Not even playing. It does not scale with the container size, it's just constant energy β‘β¨.
πΈ Example πΈ
The following code uses size to display the number of elements in a std::multiset<int>:
// Run this code
#include <iostream>
#include <set>
int main()
{
std::multiset<int> nums{1, 3, 5, 7};
std::cout << "nums contains " << nums.size() << " elements.\n";
}
π Output
nums contains 4 elements.
π₯ See also π₯
emptyβ checks whether the container is empty (public member function)max_sizeβ returns the maximum possible number of elements (public member function)sizessizeβ returns the size of a container or array (C++17) (function template) (C++20)
π That's the whole page, bestie! Source/version/date check: http://cppreference.com, 2024.06.10, page std::multiset::size(3). Mwah ππ«Ά
π¦ 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