std::multiset::count(3)

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

✨ std::multiset::count(3) ✨

Okay bestie, welcome to the C++ Standard Libary corner of the group chat 🫢. Manual name: C++ Standard Libary. This page is literally std::multiset::count(3) β€” let's get into it πŸ’….

🌸 NAME 🌸

std::multiset::count β€” std::multiset::count πŸ’–

πŸ“œ 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. No cap ✨.

  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. That's the whole vibe check πŸ¦‹.

🧸 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. Periodt πŸ’….

πŸ”₯ Complexity πŸ”₯

Logarithmic in the size of the container plus linear in the number of elements found. It's giving "log plus linear," bestie 😭.

πŸ‘‘ Notes πŸ‘‘

Feature-test macro tea β˜•:

  • 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 😭. It's literally incomplete, bestie.

πŸ’œ 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

Fresh from http://cppreference.com, version/date 2024.06.10, page std::multiset::count(3) β€” mwah, bye bestie πŸ’‹πŸ’–

πŸ“¦ where this page comes from