Udostępnij za pośrednictwem


hash_map::cbegin

[!UWAGA]

Ten interfejs API jest nieaktualny.Alternatywą jest unordered_map — Klasa.

Zwraca wartość sterująca const, adresowania pierwszym elementem hash_map.

const_iterator cbegin( ) const;

Wartość zwracana

Const sterująca dwukierunkowy adresowania pierwszym elementem w hash_map — Klasa lub lokalizacji kolejnego pustego hash_map.

Uwagi

Z zwraca wartość z cbegin, hash_map nie można modyfikować obiektu.

W Visual C++ .NET 2003, elementy członkowskie plików nagłówka <hash_map> i <hash_set> nie są już w przestrzeni nazw std, ale raczej zostały przeniesione do przestrzeni nazw stdext.Zobacz Przestrzeń nazw stdext, aby uzyskać więcej informacji.

Przykład

// hash_map_cbegin.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_map <int, int> hm1;

   hash_map <int, int> :: const_iterator hm1_cIter;
   typedef pair <int, int> Int_Pair;

   hm1.insert ( Int_Pair ( 2, 4 ) );

   hm1_cIter = hm1.cbegin ( );
   cout << "The first element of hm1 is " 
        << hm1_cIter -> first << "." << endl;
   }
  

Wymagania

Nagłówek: <hash_map>

Przestrzeń nazw: stdext

Zobacz też

Informacje

hash_map — Klasa

Standardowa biblioteka szablonów