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  |
 |
mirek
Messages: 14256 Registered: November 2005
|
Ultimate Member |
|
|
cbpporter wrote on Sat, 10 September 2016 09:00mirek wrote on Sat, 10 September 2016 08:49cbpporter wrote on Fri, 09 September 2016 10:43I 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
|
|
|
 |
|
Another String error solved, maybe.
|
 |
|
String error has not been solved
|
 |
|
Re: String error has not been solved
By: deep on Tue, 16 August 2016 11:54
|
 |
|
Re: String error has not been solved
|
 |
|
Re: Another String error solved, maybe. Not solved !!
By: nlneilson on Sat, 03 September 2016 14:36
|
 |
|
Re: Another String error solved, maybe.
By: deep on Sun, 04 September 2016 17:30
|
 |
|
Re: Another String error solved, maybe.
By: nlneilson on Sun, 04 September 2016 20:47
|
 |
|
Re: Another String error solved, maybe.
By: deep on Mon, 05 September 2016 15:24
|
 |
|
Re: Another String error solved, maybe.
By: nlneilson on Mon, 05 September 2016 18:35
|
 |
|
Re: Another String error solved, maybe.
By: cbpporter on Fri, 09 September 2016 10:43
|
 |
|
Re: Another String error solved, maybe.
By: deep on Fri, 09 September 2016 11:50
|
 |
|
Re: Another String error solved, maybe.
By: mirek on Sat, 10 September 2016 07:49
|
 |
|
Re: Another String error solved, maybe.
By: cbpporter on Sat, 10 September 2016 09:00
|
 |
|
Re: Another String error solved, maybe.
By: mirek on Sat, 10 September 2016 09:49
|
Goto Forum:
Current Time: Thu May 01 05:47:59 CEST 2025
Total time taken to generate the page: 0.03463 seconds
|