hash_map::max_size

HinweisHinweis

Diese API ist veraltet.Die Alternative ist unordered_map Class.

Gibt die maximale Länge des hash_map zurück.

size_type max_size( ) const;

Rückgabewert

Die maximal mögliche Länge des hash_map.

Hinweise

In Visual C++ .NET 2003, sind Member der <hash_map> und <hash_set> Headerdateien nicht mehr im stdnamespace, sondern sind in den stdext Namespace verschoben wurde.Weitere Informationen finden Sie unter Der stdext-Namespace.

Beispiel

// hash_map_max_size.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> :: size_type i;

   i = hm1.max_size( );   
   cout << "The maximum possible length "
        << "of the hash_map is " << i << "."
        << endl << "(Magnitude is machine specific.)";
}

Beispielausgabe

Die folgende Ausgabe ist für x86.

The maximum possible length of the hash_map is 536870911.
(Magnitude is machine specific.)

Anforderungen

Header: <hash_map>

Namespace: stdext

Siehe auch

Referenz

hash_map Class

Standardvorlagenbibliothek