
On February 20, 2014 5:48:18 PM EST, Vladimir Batov
On 02/21/2014 02:47 AM, Andrzej Krzemienski wrote:
Regarding "Type Requirements" section in documentation: TypeOut needs to be
*Copy Constructible.* Is it not enough to require that TypeOut be *MoveConstructible*?
I readily admit I am shaky about new C++11 stuff... even though it's 2014 outside... I've not had (cannot afford) any exposure to C++11 as I
am still stuck with C++03... well, at least for 2 more months... which in the airline industry is more likely 6-12 months. :-(
Still I suspect some interfaces require to be Copy Constrictible. For example,
template<typename TypeOut> struct boost::convert<TypeOut>::result { ... template<typename FallbackType> out_type value_or(FallbackType const& fallback) const { return good_ ? value_ : fallback; } };
This would address your concern: if (good_) { return std::move(value_); } else { return fallback; } However, for non-movable types, the fallback is to copy anyway, so both should be moved. ___ Rob (Sent from my portable computation engine)