fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4. #include <algorithm>
  5. #include <tuple>
  6.  
  7. struct Location {
  8. int g = 0; // Distance covered so far
  9. int h = 0; // Estimate of distance to goal
  10. float f = 0; // Estimated cost of the complete path
  11. bool walkable = 0; // 0 = Walkable, 1 = Wall
  12. };
  13.  
  14. // Structure
  15. struct Coord {
  16. int x;
  17. int y;
  18. Location location;
  19. bool operator <(const Coord& c) const { return std::tie(x,y) < std::tie(c.x,c.y); }
  20. };
  21.  
  22. int main()
  23. {
  24. std::set<Coord> coordSet;
  25. coordSet.insert(Coord{0,0,Location()});
  26. }
  27.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty