std::flat_multiset::count(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

Okay so bestie, this is the std::flat_multiset::count(3) page from the C++ Standard Libary manual. The name is literally std::flat_multiset::count β€” like, the page and the member function said β€œsame name, same energy” and honestly? Iconic. πŸ’…


✨ Synopsis ✨

Here are the signatures, copied exactly, no cap:

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;

Returns the number of elements with key that compares equivalent to the specified argument.

  1. Returns the number of elements with key key.
  2. Returns the number of elements with key that compares equivalent to the value x. This overload participates in overload resolution only if the qualified-id Compare::is_transparent is valid and denotes a type. It allows calling this function without constructing an instance of Key.

πŸŽ€ 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. That's the whole answer, bestie β€” it's giving β€œcounted and served.” 🫢


πŸ”₯ Complexity πŸ”₯

Logarithmic in the size of the container plus linear in the number of elements found. Highkey important, lowkey cute. ✨


😭 Example 😭

This section is incomplete.

Reason: no example.

Not me reading β€œno example” and feeling personally attacked 😭 but okay, that's what the page says, fr fr.

πŸ¦‹ 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

mwah πŸ’‹ β€” source/version: http://cppreference.com, date: 2024.06.10, page: std::flat_multiset::count(3). That's the whole vibe, bestie, no cap 🫢

πŸ“¦ where this page comes from