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  |
|
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
|
|
|
Goto Forum:
Current Time: Sun Aug 24 23:59:19 CEST 2025
Total time taken to generate the page: 0.05706 seconds
|