功能:
计算set容器的最大长度
语法:
size_type max_size() const;
说明:
max_size 会返回set容器的可能的最大长度。
ex:
#include<set>
#include <IOSTREAM>
using namespace std;
#define len 5
int main()
{
set<int> ctr;
set<int>::size_type st;
int i;
for( i = 0; i< len; i++)
ctr.insert(i);
cout<<"The max size of ctr is: ";
st = ctr.max_size();
cout<<st<<endl;
return 0;
}