Megosztás a következőn keresztül:


hash_map::max_size

Note

This API is obsolete. The alternative is unordered_map Class.

Returns the maximum length of the hash_map.

size_type max_size( ) const;

Return Value

The maximum possible length of the hash_map.

Remarks

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See The stdext Namespace for more information.

Example

// 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.)";
}

Sample Output

The following output is for x86.

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

Requirements

Header: <hash_map>

Namespace: stdext

See Also

Reference

hash_map Class

Standard Template Library