Home » U++ Library support » U++ Core » operator< for container sorting (small confusion)
operator< for container sorting (small confusion) [message #13071] |
Sat, 08 December 2007 20:10  |
Andy2222
Messages: 4 Registered: December 2007
|
Junior Member |
|
|
I'm trying to store my own data type inside a Index<> so far i made it "movable" and it has the needed hashing call and a == operator.
Im just not sure how can i sort the Index using the Sort() function?
I saw some examples where the global operator< is overloaded by like this.
bool operator<(const XDCCPackage& a, const XDCCPackage& b)
{
return a.Filename < b.Filename;
}
So i don't define one inside the class and overload the global operator<?
I tryed doing this but it seem also need to define the operator= or a swap call?
Little confused right now small hints pls?
PS: is there a U++ nooby section?
[Updated on: Sat, 08 December 2007 20:10] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 28 23:34:23 CEST 2025
Total time taken to generate the page: 0.03604 seconds
|