Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums
Members
Pages
Search
Help
Register
Login
Home
Home
»
U++ Library support
»
U++ Core
»
operator< for container sorting (small confusion)
Show:
Today's Messages
::
Show Polls
::
Message Navigator
E-mail to friend
Re: operator< for container sorting (small confusion)
[
message #13073
is a reply to
message #13071
]
Sun, 09 December 2007 07:54
mirek
Messages:
14257
Registered:
November 2005
Ultimate Member
Andy2222 wrote on Sat, 08 December 2007 14:10
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?
Well, it can be global, but IMO the main problem is that you cannot Sort Index (that is that missing Swap).
If you really need to sort Index, convert it to Vector, sort and convert back.
(Use PickKeys to convert to Vector and constructor variant for conversion back).
Mirek
Report message to a moderator
[
Message index
]
operator< for container sorting (small confusion)
By:
Andy2222
on Sat, 08 December 2007 20:10
Re: operator< for container sorting (small confusion)
By:
mirek
on Sun, 09 December 2007 07:54
Re: operator< for container sorting (small confusion)
By:
Andy2222
on Sun, 09 December 2007 14:48
Re: operator< for container sorting (small confusion)
By:
mirek
on Sun, 09 December 2007 16:18
Previous Topic:
<<= and <<
Next Topic:
A couple of issues with a test app
Goto Forum:
- Community
U++ community news and announcements
PR, media coverage, articles and documentation
U++ Webs: Functioning, Layout , Design, Features and Structure of these forums, homepage etc.
Coffee corner
Newbie corner
U++ based job offers
- Developing U++
U++ Developers corner
External resources
Releasing U++
UppHub
Bugs (& fixes)
Documentation
U++ TheIDE and Library: Releases and ChangeLogs
Mac OS
Android
- U++ Library support
U++ Library : Other (not classified elsewhere)
U++ Core
Look and Chameleon Technology
U++ Libraries and TheIDE: i18n, Unicode and Internationalization
U++ SQL
U++ MT-multithreading and servers
U++ Callbacks and Timers
U++ Widgets - General questions or Mixed problems
TopWindow&PopUp, TrayIcon
Menus&Toolbars
StatusBar&InfoCtrl
Splitter
TabCtrl
Slider&ProgressIndicator
ArrayCtrl, HeaderCtrl & GridCtrl
TreeCtrl
RichText,QTF,RTF...
LineEdit, EditFields, DocEdit
Draw, Display, Images, Bitmaps, Icons
FileSel&FileList, Path
CalendarCtrl
Skylark
ScatterDraw & ScatterCtrl
Archive
- U++ TheIDE
U++ TheIDE: Other Features Wishlist and/or Bugs
U++ TheIDE: Compiling, Linking, Debugging of your packages
U++ TheIDE: Installation, Compiling and Running of theide
U++ TheIDE: CodeEditor, Assist++, Topic++
U++ TheIDE: Packages
U++ TheIDE: Layout (Forms) Designer
U++ TheIDE: Icon designer
- Extra libraries, Code snippets, applications etc.
U++ users applications in progress and useful code snippets, including reference examples!
U++ Esc Interpreter, Esc Macros and templates
C++ language problems and code snippets
Applications created with U++
OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc
-=]
Back to Top
[=-
[
Syndicate this forum (XML)
] [
] [
]
Current Time:
Wed May 07 22:07:29 CEST 2025
Total time taken to generate the page: 0.02598 seconds