set::lower_bound (STL/CLR)

尋找符合指定的索引鍵的範圍開始。

    iterator lower_bound(key_type key);

參數

  • Key - 索引鍵
    若要搜尋的索引鍵值。

備註

成員函式會判斷第一個項目X中具有相等的順序,以受控制序列key。如果沒有這類項目就會存在,則會傳回set::end (STL/CLR)()。 否則它會傳回 iterator,指派X。您可以用它來在受控制序列的比對指定的索引鍵中目前找出項目的序列的開頭。

範例

// cliext_set_lower_bound.cpp 
// compile with: /clr 
#include <cliext/set> 
 
typedef cliext::set<wchar_t> Myset; 
int main() 
    { 
    Myset c1; 
    c1.insert(L'a'); 
    c1.insert(L'b'); 
    c1.insert(L'c'); 
 
// display initial contents " a b c" 
    for each (wchar_t elem in c1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
    System::Console::WriteLine("lower_bound(L'x')==end() = {0}", 
        c1.lower_bound(L'x') == c1.end()); 
 
    System::Console::WriteLine("*lower_bound(L'a') = {0}", 
        *c1.lower_bound(L'a')); 
    System::Console::WriteLine("*lower_bound(L'b') = {0}", 
        *c1.lower_bound(L'b')); 
    return (0); 
    } 
 
  

需求

標頭: < cliext/設定 >

Namespace: cliext

請參閱

參考

set (STL/CLR)

set::count (STL/CLR)

set::equal_range (STL/CLR)

set::find (STL/CLR)

set::upper_bound (STL/CLR)