本文整理汇总了C++中HT::find方法的典型用法代码示例。如果您正苦于以下问题:C++ HT::find方法的具体用法?C++ HT::find怎么用?C++ HT::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HT
的用法示例。
在下文中一共展示了HT::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(){
HT myTable;
cout<<"Inserting..."<<endl;
myTable.insert(2,"mike");
myTable.insert(12,"kalgecin");
myTable.insert(52,"michael");
//cout<<"1"<<endl;
myTable.insert(59,"yasin");
//cout<<2<<endl;
myTable.insert(51,"frank");
//cout<<3<<endl;
cout<<"Done inserting"<<endl;
try{
cout<<"kalgecin is "<<myTable.find("kalgecin")<<endl;
cout<<"69 is "<<myTable.find(59)<<endl;
}catch(string s){
cout<<s<<endl;
}
return 0;
}
示例2: find
/** Finds an element in the set.
*
* @param item the item to look for
*
* @return a #const_iterator pointing to the item, or @p end() if the
* item cannot be found in the set.
*/
iterator find( const value_type& item ) const
{ return m_ht.find( item ); }
示例3: find
/** Finds an element whose key is @a key
*
* @param key the key of the item
*
* @return a #const_iterator pointing to the item, or @p end() if the key
* cannot be found in the map.
*/
const_iterator find( const key_type& key ) const
{ return m_ht.find( key ); }