Skip to content

Instantly share code, notes, and snippets.

@khalefa-phd
Last active May 13, 2021 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khalefa-phd/493b8a0742d0facc04ea25f5d38c0d35 to your computer and use it in GitHub Desktop.
Save khalefa-phd/493b8a0742d0facc04ea25f5d38c0d35 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <unordered_map>
using namespace std;
int main(){
unordered_map<int, int> h;
for(long i=0;; i++)
{
try{
h[i]=i;
if(i%1000000==0){
cout << i << "\n";
std::cout << "max_size = " << h.max_size() << std::endl;
std::cout << "max_bucket_count = " << h.max_bucket_count() << std::endl;
std::cout << "max_load_factor = " << h.max_load_factor() << std::endl;
}
} catch (const std::exception& e) {
std::cout << "Exception failed: " << e.what() << '\n';
}
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment