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 » broken pick semantics
Re: broken pick semantics [message #37828 is a reply to message #37826] Fri, 16 November 2012 07:31 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1792
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

crydev wrote on Thu, 15 November 2012 22:59

It makes sense to me though. Because I used a normal value object as parameter it already copied the contents of the vector, which using pick semantics, resulted in the original vector being empty. By using a reference pointer to the original vector, the pick assignment is not used, avoiding this problem. Am I correct?
Yes, when you just pass a reference around, it is still one object and no copying is necessary. It is actually (IMHO) better practice, to avoid copies by using references everywhere where possible.

Honza
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thread with parametarized callback?
Next Topic: dropdown submenu into ToolBar
Goto Forum:
  


Current Time: Sun Aug 24 23:59:19 CEST 2025

Total time taken to generate the page: 0.05706 seconds