
4 Oct
2011
4 Oct
'11
9:52 p.m.
On 4 October 2011 16:05, Matt Calabrese <rivorus@gmail.com> wrote:
Type&& operator +( Type&& left, Type const& right ) { left += right; return std::move( left ); }
Anyway, as was pointed out, this is probably not a good idea for other reasons, such as people expecting to be able to bind the result to a reference and have its life extended (though I suppose you could just rule-out such uses as valid when the base is used).
What happens with: Type t = TypeFactory(); auto sum = TypeFactory() + t; -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404