1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// map::max_size
#include <iostream>
#include <map>
int main ()
{
int i;
std::map<int,int> mymap;
if (mymap.max_size()>1000)
{
for (i=0; i<1000; i++) mymap[i]=0;
std::cout << "The map contains 1000 elements.\n";
}
else std::cout << "The map could not hold 1000 elements.\n";
return 0;
}
| |