Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-10-01 10:41:19


Gregory Colvin wrote:
> Still wondering.
>
> On Tuesday, Sep 30, 2003, at 11:09 America/Denver, Gregory Colvin
> wrote:
>> Given
>>
>> template<typename T> shifted_ptr<T> make_shifted_ptr(cont T& t) {
>> return shifted_ptr(new(so) T(t));
>> }
>>
>> ... make_shifted_ptr(Stuff()) ...
>>
>> are compilers allowed to optimize away the copy and construct the
>> Stuff in place?
>>
>> If so, do they?

Those that I tried don't. Even if they did, a public copy constructor would
still be needed.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk