std::flat_map::count(3)
π¦ std::flat_map::count(3) β C++ Standard Libary edition π¦
π NAME π
std::flat_map::count is literally std::flat_map::count β that's the name, bestie, no cap π
π§Ύ Synopsis π§Ύ
okay so here's the signature lineup fr fr:
size_type count( const Key& key ) const; (1) (since C++23)
template< class K > (2) (since C++23)
size_type count( const K& x ) const;
It returns the number of elements with key that compares equivalent to the specified argument π«Ά
- Returns the number of elements with key
key. This is either1or0since this container does not allow duplicates. - Returns the number of elements with key that compares equivalent to the value
x. This overload participates in overload resolution only if the qualified-idCompare::is_transparentis valid and denotes a type. It allows calling this function without constructing an instance ofKey.
π Parameters π
keyβ key value of the elements to countxβ alternative value to compare to the keys
β Return value β
Number of elements with key that compares equivalent to key or x, which, for overload (1), is either 1 or 0 β¨
π₯ Complexity π₯
Logarithmic in the size of the container plus linear in the number of elements found π₯
π Example π
This section is incomplete Reason: no example
bestie the example section is literally empty, and I respect the honesty π
π See also π
findβ finds element with specific key (public member function)equal_rangeβ returns range of elements matching a specific key (public member function)
ποΈ Category ποΈ
Todo no example
source/version/date sign-off: http://cppreference.com Β· 2024.06.10 Β· std::flat_map::count(3) β that's the whole page, bestie. 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