std::map::count(3)
πΈ NAME πΈ
okay so this is std::map::count(3), straight from the C++ Standard Libary manual β yes bestie, βLibaryβ with one βr,β weβre keeping it exactly like that π«Ά.
std::map::count - std::map::count (the name is the name, no notes π
).
β¨ Synopsis β¨
size_type count( const Key& key ) const; (1)
template< class K > (2) (since C++14)
size_type count( const K& x ) const;
Returns the number of elements with key that compares equivalent to the specified argument. Letβs break it down:
- Returns the number of elements with key
key. This is either1or0since this container does not allow duplicates. periodt, no dupes allowed π - 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. iconic behavior honestly π
π Parameters π
keyβ key value of the elements to count πxβ 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. thatβs it, thatβs the tea β
π¦ Complexity π¦
Logarithmic in the size of the container plus linear in the number of elements found. so like, sheβs not free, but sheβs not doing a full sweep either, iykyk β¨
π Notes π
feature-test macro vibe check π
- Feature-test macro:
__cpp_lib_generic_associative_lookup - Value:
201304L - Std:
(C++14) - Feature: Heterogeneous comparison lookup in associative containers; overload (2)
π Example π
This section is incomplete.
Reason: no example.
bestie they left us hanging π no example, but the reason is literally βno exampleβ β we 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:http://cppreference.comβ dated2024.06.10. mwah π slay.
π¦ 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