std::flat_map::upper_bound(3)

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

πŸ’– std::flat_map::upper_bound πŸ’–

okay so bestie, this is the std::flat_map::upper_bound(3) page from the C++ Standard Libary manual, and it's literally here to help you find the first element that's greater than a key. no cap. πŸ¦‹

🌸 NAME 🌸

std::flat_map::upper_bound β€” std::flat_map::upper_bound

✨ Synopsis ✨

all four overloads are (since C++23) β€” yes bestie, C++23 girlies stay winning πŸ’…

          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.

πŸŽ€ 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.

πŸ”₯ Complexity πŸ”₯

Logarithmic in the size of the container.

πŸ“ Example πŸ“

This section is incomplete 😭

Reason: no example

πŸ‘‘ 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

okay bestie, that's the whole page πŸ’– source/version + date drop: http://cppreference.com, 2024.06.10, and the page is std::flat_map::upper_bound(3) β€” periodt. 🫢✨

πŸ“¦ where this page comes from