U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » operator< for container sorting (small confusion)
icon5.gif  operator< for container sorting (small confusion) [message #13071] Sat, 08 December 2007 20:10 Go to previous message
Andy2222 is currently offline  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? Smile

[Updated on: Sat, 08 December 2007 20:10]

Report message to a moderator

 
Read Message icon5.gif
Read Message
Read Message
Read Message
Previous Topic: <<= and <<
Next Topic: A couple of issues with a test app
Goto Forum:
  


Current Time: Tue Apr 28 19:09:09 GMT+2 2026

Total time taken to generate the page: 0.00443 seconds