std::unorde...ltiset::size(3)
π std::unorde...ltiset::size(3) π
okay bestie, welcome to the C++ Standard Libary manual page for std::unordered_multiset::size β yes, the header is literally std::unorde...ltiset::size(3) and weβre keeping the vibe. This is a C++11-and-later situation. π«Ά
πΈ NAME πΈ
std::unordered_multiset::size - std::unordered_multiset::size, literally no cap.
β¨ Synopsis β¨
size_type size() const noexcept; (since C++11)
Returns the number of elements in the container, i.e. std::distance(begin(), end()). π
π Parameters π
(none) β not a single parameter, bestie. π
π¦ Return value π¦
The number of elements in the container. Thatβs the whole mood. β¨
π Complexity π
Constant. O(1) energy, always iconic. π
π Example π
The following code uses size to display the number of elements in a std::unordered_multiset<int>:
// Run this code
#include <iostream>
#include <unordered_set>
int main()
{
std::unordered_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)sizeβ listed in SEE ALSOssizeβ returns the size of a container or array- the original SEE ALSO block also shows
(C++17),(function template), and(C++20)
- the original SEE ALSO block also shows
okay thatβs the whole page, bestie β go count your elements with confidence. π
source: http://cppreference.com Β· version/page date: 2024.06.10 Β· page: std::unorde...ltiset::size(3) π
π¦ 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