fork download
  1. #include <vector>
  2. #include <algorithm>
  3.  
  4. template <class ED>
  5. struct EdgeData1 {
  6. bool operator< (const EdgeData1<ED>& other) const { return indexTo < other.indexTo; }
  7. int indexTo;
  8. ED edgeData;
  9. };
  10.  
  11. template <class ED>
  12. struct EdgeData2 {
  13. int indexTo;
  14. ED edgeData;
  15. };
  16. template <class ED>
  17. bool operator<(const EdgeData2<ED>& l, const EdgeData2<ED>& r) { return l.indexTo < r.indexTo; }
  18.  
  19. std::vector<EdgeData1<int>> v1;
  20. std::vector<EdgeData2<int>> v2;
  21.  
  22. int main() {
  23. std::is_sorted(cbegin(v1), cend(v1));
  24. std::is_sorted(cbegin(v2), cend(v2));
  25. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty