|
-
January 12th, 2009, 04:12 PM
#5
Re: Copy constructors and base Classes
Another important consideration is that the compiler may optimize copies out of existance....
This typically happens....
1) RVO [Return Value Optimization]. The return value may actually be created directly on the return stack, and there be NO copy performed.
2) Value Parameter Passing. If the compiler (or linker in some cases) has access to the implementation of a method taking an object by value, the copy of the object may be also avoided, provided it does not alter the functional semantics.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|