Boost logo

Boost Users :

Subject: Re: [Boost-users] [move] case study: simple cloning smart pointer
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2012-07-16 16:09:28


El 16/07/2012 13:54, Krzysztof Czainski escribió:

> Version 1: C++03 vs. C++0x:
> - the last 4 use cases {{{ ptr<A> b = make_b(); ptr<A> c( make_b() ); a
> = make_a(); b = make_b(); }}} introduce a deep copy in version C++03,
> while while the deep copy is avoided in C++0x.

Thanks for the report. It's a pity that current move emulation does not
catch rvalues of convertible types to avoid the copy. Maybe for the last
two cases you could try with BOOST_COPY_ASSIGN_REF(ptr<U>) to see if the
deep copy is avoided.

Best,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net