1
0

noex.cpp 830 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4. #include <numeric>
  5. #include <vector>
  6. #include <algorithm>
  7. #include <unordered_set>
  8. using namespace std;
  9. struct S {double a; double b;};
  10. int main()
  11. {
  12. S a = {1.1,2.2};
  13. S b = {2.1,4.2};
  14. S c = {3.1,5.2};
  15. unordered_set<S*> us;
  16. us.insert(&a);
  17. us.insert(&b);
  18. us.insert(&c);
  19. for_each(us.begin(),us.end(),[](S* i) {cout << (*i).a << ", ";});
  20. cout << "\nNext\n";
  21. /* if(pt != vi.end())
  22. cout << *pt << endl;
  23. else
  24. cout << "not found\n";
  25. cout << vi.count("cow") << endl;
  26. cout << vi.count("fondu") << endl;
  27. cout << endl;
  28. cout << *vi.lower_bound("cow") << endl;
  29. cout << *vi.upper_bound("hen") << endl;
  30. cout << vi.bucket_count() << endl;
  31. cout << vi.bucket("cow") << endl;
  32. cout << vi.bucket("starkA") << endl;
  33. cout << vi.bucket("stark") << endl;*/
  34. cin.get();
  35. }