std::set::upper_bound(3)
π std::set::upper_bound(3) π
okay so bestie, welcome to the C++ Standard Libary page for std::set::upper_bound β it's giving βone very specific set member functionβ and we're gonna learn it together, no cap π«Άβ¨
π NAME π
std::set::upper_bound β std::set::upper_bound
not me just restating the name, but make it cute π
β¨ Synopsis β¨
iterator upper_bound( const Key& key ); (1)
const_iterator upper_bound( const Key& key ) const; (2)
template< class K > (3) (since C++14)
iterator upper_bound( const K& x );
template< class K > (4) (since C++14)
const_iterator upper_bound( const K& x ) const;
- (1,2) return an iterator pointing to the first element that is greater than
key. - (3,4) return an iterator pointing to the first element that compares greater 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.
πΈ Parameters πΈ
keyβ key value to compare the elements toxβ alternative value that can be compared toKey
π Return value π
An 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. literally logarithmic, bestie π
π§ Notes π§
feature-test macro tea β:
__cpp_lib_generic_associative_lookupβ value201304L, standard(C++14), feature: Heterogeneous comparison lookup in associative containers, for overloads (3,4).
π 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
mwah π that's the whole page β source: http://cppreference.com, version/date: 2024.06.10 ππ
π¦ 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