hash_set::crbegin

注意事項注意事項

這個 API 已經過時。這個選項是 unordered_set Class

傳回 const 定址 Iterator 以反轉 hash_set 的第一個項目。

const_reverse_iterator crbegin( ) const;

傳回值

const 相反定址雙向 Iterator 的解決反轉 hash_set Class 的第一個項目或還沒有 unreversed hash_set的最後一個項目。

備註

hash_set::begin 搭配 hash_set,crbegin 搭配反轉 hash_set。

傳回值 crbegin,無法修改 hash_set 物件。

crbegin 可以用來傳遞 hash_set 向後逐一查看。

在 Visual C++ .NET Pocket PC, <hash_map><hash_set> 標頭檔 (Header File) 的成員不在 std 命名空間,,而是移至 stdext 命名空間。如需詳細資訊,請參閱 stdext 命名空間

範例

// hash_set_crbegin.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1;
   hash_set <int>::const_reverse_iterator hs1_crIter;

   hs1.insert( 10 );
   hs1.insert( 20 );
   hs1.insert( 30 );

   hs1_crIter = hs1.crbegin( );
   cout << "The first element in the reversed hash_set is "
        << *hs1_crIter << "." << endl;
}
  

需求

標題: <hash_set>

命名空間: stdext

請參閱

參考

hash_set Class

標準樣板程式庫