std::flat_set::size(3)
π NAME π
std::flat_set::size - std::flat_set::size β yes bestie, the name is literally the name twice. This is the std::flat_set::size(3) page from the C++ Standard Libary manual, and we are keeping every detail, periodt.
β¨ Synopsis β¨
size_type size() const noexcept; (since C++23)
Returns the number of elements in the container adaptor. Equivalent to return c.size().
π Parameters π
(none) β zero parameters, the parameter section is empty and thriving.
π«Ά Return value π«Ά
The number of elements in the container adaptor.
β‘ Complexity β‘
Constant.
πΈ Example πΈ
The following code uses size to display the number of elements in a std::flat_set<int>:
// Run this code
#include <iostream>
#include <flat_set>
int main()
{
std::flat_set<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 adaptor is empty (public member function)sizessizeβ returns the size of a container or array (function template)(C++17),(C++20)β version tags listed in this See also blockmax_sizeβ returns the maximum possible number of elements (public member function)
source/version and date: http://cppreference.com Β· 2024.06.10 Β· page std::flat_set::size(3) β bye bestie, go count some elements π
β¨
π¦ 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