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 » Sorting a ValueArray ?
Re: Sorting a ValueArray ? [message #42916 is a reply to message #42911] Mon, 14 April 2014 13:46 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
mingodad wrote on Mon, 14 April 2014 09:49
Hello !

How to sort a ValueArray ? Trying to use Sort() gives this error:


Right now, you would have to create Vector<Value> from elements, Sort, create new ValueArray.

It is pretty untypical requirement.

Quote:

Should we have the missing Begin() and End() implemented on ValueArray ?


Would not really help as they would have to be const. It is impossible to make non-const references to ValueArray elements available. The reason is that if allowed, it is pretty simple to create referential cycles, resulting in memory leaks.

Think: ValueArray va; va.Add(); va[0] = va;

Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Testscatter2 issue
Next Topic: Convert C# code to U++?
Goto Forum:
  


Current Time: Wed Jun 12 12:51:16 CEST 2024

Total time taken to generate the page: 0.02295 seconds