std::flat_m...:upper_bound(3)

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

πŸ’– std::flat_multiset::upper_bound πŸ’–

Okay so you're reading the C++ Standard Libary manual page for std::flat_multiset::upper_bound, aka page id std::flat_m...:upper_bound(3). Bestie, this one is lowkey simple: it finds the first thing that is greater than your key. Periodt. πŸ’…

✨ NAME ✨

std::flat_multiset::upper_bound β€” std::flat_multiset::upper_bound (yes, the name is the name, iconic behavior fr fr πŸŽ€)

πŸ¦‹ Synopsis πŸ¦‹

iterator upper_bound( const Key& key );             (1) (since C++23)
const_iterator upper_bound( const Key& key ) const; (2) (since C++23)
template< class K >                                 (3) (since C++23)
iterator upper_bound( const K& x );
template< class K >                                 (4) (since C++23)
const_iterator upper_bound( const K& x ) const;

1, 2) Returns an iterator pointing to the first element that is greater than key.

3, 4) Returns an iterator pointing to the first element that compares greater 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. Iykyk β€” transparent comparator main character energy. 🫢

🌸 Parameters 🌸

  • key β€” key value to compare the elements to
  • x β€” alternative value that can be compared to Key

πŸ‘‘ Return value πŸ‘‘

Iterator pointing to the first element that is greater than key. If no such element is found, past-the-end (see end()) iterator is returned. That’s the β€œnothing matches, bestie, go to the end” vibe. 😭

πŸ”₯ Complexity πŸ”₯

Logarithmic in the size of the container. Slay, efficient. ⭐

πŸ’€ Example πŸ’€

This section is incomplete.

Reason: no example.

Not me showing up to the example section and it’s literally empty πŸ™ˆ β€” but that’s what the page says, so we keep it exactly like that.

🌈 See also 🌈

  • equal_range β€” returns range of elements matching a specific key (public member function)
  • lower_bound β€” returns an iterator to the first element not less than the given key (public member function)

πŸ“ Category πŸ“

* Todo no example


That’s the whole page, bestie! Source/version/date flex: http://cppreference.com, 2024.06.10, and page id std::flat_m...:upper_bound(3). Byeee πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from