hash_map::max_size

注意事項注意事項

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

傳回 hash_map 的最大長度。

size_type max_size( ) const;

傳回值

hash_map 的最大可能長度。

備註

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

範例

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

範例輸出

下列輸出是 x86。

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

需求

標題: <hash_map>

命名空間: stdext

請參閱

參考

hash_map Class

標準樣板程式庫