set::max_size

返回集合的最大长度。

size_type max_size( ) const;

返回值

集的可能的最大长度。

示例

// set_max_size.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;   
   set <int> s1;
   set <int>::size_type i;

   i = s1.max_size( );   
   cout << "The maximum possible length "
        << "of the set is " << i << "." << endl;
}

示例输出

将生成下面关于x86的输出。

The maximum possible length of the set is 1073741823.

要求

标头: <set>

命名空间: std

请参见

参考

set 类

set::max_size(STL 示例)

标准模板库