fork(11) download
  1. #include <tuple>
  2. #include <set>
  3.  
  4. struct pointsSet {
  5. double p1;
  6. double p2;
  7. double p3;
  8. };
  9.  
  10. bool operator<(const pointsSet& lhs, const pointsSet& rhs)
  11. {
  12. return std::tie(lhs.p1, lhs.p2, lhs.p3) < std::tie(rhs.p1, rhs.p2, rhs.p3);
  13. }
  14.  
  15. void foo()
  16. {
  17. std::set<pointsSet> setBoundaryPoints;
  18.  
  19. double p[3] = {1,2,3};
  20. pointsSet pt = {p[0], p[1], p[2]};
  21. setBoundaryPoints.insert(pt);
  22.  
  23. }
  24.  
  25. int main()
  26. {
  27. foo();
  28. }
Success #stdin #stdout 0s 3012KB
stdin
Standard input is empty
stdout
Standard output is empty