fork download
  1. #include <iostream>
  2. #include <set>
  3.  
  4. int main ()
  5. {
  6. int i;
  7. std::set<int> myset;
  8.  
  9. if (myset.max_size() > 5)
  10. {
  11. myset.insert(1);
  12. myset.insert(2);
  13. myset.insert(3);
  14. myset.insert(4);
  15. myset.insert(5);
  16. std::cout << "The set can hold " << myset.max_size() << " elements.\n";
  17. std::cout << "The set currently holds 5 elements.\n";
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 4532KB
stdin
Standard input is empty
stdout
The set can hold 461168601842738790 elements.
The set currently holds 5 elements.