◐ Shell
clean mode source ↗

std::set<Key,Compare,Allocator>::upper_bound - cppreference.com

提供: cppreference.com

<tbody> </tbody>

iterator upper_bound( const Key& key );

(1)

const_iterator upper_bound( const Key& key ) const;

(1)

template< class K > iterator upper_bound( const K& x );

(2) (C++14以上)

template< class K > const_iterator upper_bound( const K& x ) const;

(2) (C++14以上)

1) key より大きい最初の要素を指すイテレータを返します。

2)x より大きい最初の要素を指すイテレータを返します。 このオーバーロードは、修飾識別子 Compare::is_transparent が有効で、型を表す場合場合にのみ、オーバーロード解決に参加します。 これにより Key のインスタンスを構築せずにこの関数を呼ぶことが可能となります。

引数

key - 要素と比較するキーの値
x - Key と比較可能な代わりの値

戻り値

key より大きい最初の要素を指すイテレータ。 そのような要素がなければ、終端イテレータ (end() を参照) が返されます。

計算量

コンテナのサイズの対数。

関連項目