|
Boost Users : |
Subject: Re: [Boost-users] [Review] Formal Review: Boost.Move
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-05-23 15:09:32
AMDG
Ion Gaztañaga wrote:
> On 23/05/2010 14:38, Neil Groves wrote:
>> So am I correct in stating that the move emulation is therefore
>> fundamentally relying upon undefined behaviour with no performant
>> alternative that uses the same interface?
>
> It seems so, but I'm not sure. We'll need to confirm this with a
> language expert. If the problem is GCC, we can workaround it.
> Hopefully move emulation works nearly for all compilers and in the
> future all of them will have rvalus references, so I don't think we
> have a big issue here.
I'm wondering whether it would be better to
use something like
template<class T>
struct rv {
T* impl;
operator const T&() const;
};
template<class T>
T& unwrap_rv(rv<T>&);
I know the interface isn't quite as nice, and
there will be more cases where overload resolution
needs a hand, but it seems safer.
In Christ,
Steven Watanabe
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