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 » [SOLVED] Cloning Array of complexe type
Re: Cloning Array of complexe type [message #53278 is a reply to message #53269] Wed, 25 March 2020 19:33 Go to previous messageGo to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Koldo, Thanks a lot for taking time to help me,

Your solution worked even without inherritance of A from MoveableAndDeepCopyOption.
But instead of doing this :
ArrayMap<Upp::String, A> aCopy;
	for (int i = 0; i < myArrays.GetCount(); ++i)
		aCopy.Add(myArrays.GetKey(i), pick(myArrays[i].clone()));

I'm surprised that ArrayMap don't have a simple function to do this.
However I have a little question, since My clone return a pointer to a static memory object wich is moved to the fresh object created by array,
what happen to this static allocation since I never delete anywhere this memory chunk ? Will it became a memory leak ?

Thanks in advance
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ProgressIndicator issue
Next Topic: Read txt, analyze and convert to csv
Goto Forum:
  


Current Time: Mon Apr 29 04:35:44 CEST 2024

Total time taken to generate the page: 0.03088 seconds