Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Another String error solved, maybe. ( String error)
Re: Another String error solved, maybe. [message #46915 is a reply to message #46914] Sat, 10 September 2016 09:49 Go to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
cbpporter wrote on Sat, 10 September 2016 09:00
mirek wrote on Sat, 10 September 2016 08:49
cbpporter wrote on Fri, 09 September 2016 10:43
I found another thing related to String and I'm not sure of it should work with the new core or not.

Index<String>  words;
Sort(words);


This won't compile. Is it supposed to?


No.

But you can use 'SortIndex'.

Mirek

Interesting design.

Why no overload Sort for Index to call SortIndex? Would help random users.


Well, maybe. However, 'Sort' is meant to be generic sorting algorithm for containers with certain set of requirements and all it does is sorting. Index does not match these requirements.

Sorting Index is quite more complex, as it works by converting Index to Vector, sorting, then recreating Index back (restoring hashing info). Maybe the warning that you are doing something unusual is in place here... Forcing user to write SortIndex instead of just Sort to acknowledge this fact is the idea....

Mirek

[Updated on: Sat, 10 September 2016 09:49]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I swap the Ctrl in the TabCtrl ?
Next Topic: Image to an SQLite blob windows 10
Goto Forum:
  


Current Time: Wed May 08 17:19:34 CEST 2024

Total time taken to generate the page: 0.02017 seconds