次の方法で共有


hash_map::lower_bound (STL/CLR)

指定したキーに一致する範囲の開始を検索します。

    iterator lower_bound(key_type key);

パラメーター

  • key
    検索するキー値。

解説

メンバー関数は key と同じバケットにハッシュし、 key等しい場合は、被制御シーケンスの最初の要素 X を決定します。そのような要素が存在しない場合、 hash_map::end (STL/CLR)を返します(); それ以外の場合は Xを指定する反復子を返します。指定したキーに一致する被制御シーケンスの要素のシーケンスの開始を現在の検索に使用します。

使用例

// cliext_hash_map_lower_bound.cpp 
// compile with: /clr 
#include <cliext/hash_map> 
 
typedef cliext::hash_map<wchar_t, int> Myhash_map; 
int main() 
    { 
    Myhash_map c1; 
    c1.insert(Myhash_map::make_value(L'a', 1)); 
    c1.insert(Myhash_map::make_value(L'b', 2)); 
    c1.insert(Myhash_map::make_value(L'c', 3)); 
 
// display contents " [a 1] [b 2] [c 3]" 
    for each (Myhash_map::value_type elem in c1) 
        System::Console::Write(" [{0} {1}]", elem->first, elem->second); 
    System::Console::WriteLine(); 
 
    System::Console::WriteLine("lower_bound(L'x')==end() = {0}", 
        c1.lower_bound(L'x') == c1.end()); 
 
    Myhash_map::iterator it = c1.lower_bound(L'a'); 
    System::Console::WriteLine("*lower_bound(L'a') = [{0} {1}]", 
        it->first, it->second); 
    it = c1.lower_bound(L'b'); 
    System::Console::WriteLine("*lower_bound(L'b') = [{0} {1}]", 
        it->first, it->second); 
    return (0); 
    } 
 
  

必要条件

ヘッダー: <cliext/hash_map>

名前空間: の cliext

参照

関連項目

hash_map (STL/CLR)

hash_map::count (STL/CLR)

hash_map::equal_range (STL/CLR)

hash_map::find (STL/CLR)

hash_map::upper_bound (STL/CLR)