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 » U++ Library support » U++ Core » VectorMap.Get (Problem fetching value of vectormap second time)
Re: VectorMap.Get [message #45238 is a reply to message #45232] Thu, 15 October 2015 11:02 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
[quote title=Klugier wrote on Tue, 13 October 2015 16:38]Hello Deep,

Try to clone your vector. I think in your case there is move operation for some reason. Maybe someone that knows better that mechanism can describe it for you. [code]

Yes, it is 'pick' (U++ variant of move).

In C++11 mode, the code would not even compile. Unfortunately, before c++11, there are no means to detect these errors at compile time.

Note that the optimal variant to using 'clone' is to use const reference (unless you need to change the element you are getting).

const Vector<int>& v2 = Vm.Get("key1");


Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Suggestion for StringBuffer
Next Topic: LocalProcess child process killing in WIndows
Goto Forum:
  


Current Time: Sun May 05 08:53:50 CEST 2024

Total time taken to generate the page: 0.02239 seconds