Quantcast
Channel: User BobbyShaftoe - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Answer by BobbyShaftoe for How do I sort a vector of custom objects?

$
0
0

In your class, you may overload the "<" operator.

class MyClass{  bool operator <(const MyClass& rhs)  {    return this->key < rhs.key;  }}

Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>