Warp <war### [at] tag povray org> wrote:
> Actually if you have a function like:
> std::vector<int> createVector(whatever) { ... }
> and then call it like:
> std::vector<int> myVector = createVector(whatever);
> the compiler will most probably be able to optimize the copying away.
Oh, and I forgot to say: The compiler doesn't even need to see the
implementation of 'createVector()' in order to do this optimization.
In other words, the compiler doesn't require to be able to inline that
function to do the optimization. The implementation of that function
could be in another compilation unit, or it could even be in a
precompiled library.
--
- Warp
Post a reply to this message
|