C++ Logo

std-proposals

Advanced search

std::expected (P0323R9) - rhs.error() not moved when it should be?

From: Emile Cormier <emile.cormier.jr_at_[hidden]>
Date: Tue, 6 Oct 2020 17:44:10 -0300
I have noticed the following circumstance that specifies rhs.error() be
copied instead of moved:

expected<T, E>& operator=(unexpected<G>&& e);

For the case !bool(*this), it says: "move assign unexpected(e.error()) to
unex"

I think it should be: "move assign unexpected(std::move(e.error())) to
unex", given the is_nothrow_move_constructible_v<E> constraint.

I'm guessing it's a copy-paste error, or am I missing something?

Reported here: https://github.com/viboes/std-make/issues/42

Cheers,
Emile Cormier

Received on 2020-10-06 15:44:24