fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <vector>
  4. #include <typeinfo>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. vector<int> intVector{{ 1, 2, 3, 4, 5, 6 }};
  10. // your code goes here
  11. map<uint32_t, char> mapch{ {1, 'a'}, {2, 'b'} };
  12.  
  13. cout << intVector.size() << endl;
  14. // cout << "mapch.keys: " << mapch.keys() << endl;
  15. // cout << "mapch.hash_code(): " << typeid(make_pair<uint32_t, char>(0, 'x')).hash_code() << endl;
  16. cout << "mapch.hash_code(): " << typeid(make_pair<uint32_t, char>).hash_code() << endl;
  17. cout << "mapch.hash_code(): " << typeid(make_pair<uint32_t, char>).hash_code() << endl;
  18.  
  19. for (const auto& p: mapch) {
  20. if (p.first <= 2)
  21. cout << typeid(p).name() << " hash: " << typeid(p).hash_code() << endl;
  22. cout << p.first << " " << p.second << endl;
  23. return 0;
  24. }
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
6
mapch.hash_code(): 16981818988750020495
mapch.hash_code(): 16981818988750020495
St4pairIKjcE hash: 3003595669363600589
1 a