C++ Logo

STD-PROPOSALS

Advanced search

Subject: [std-proposals] std::expected (P0323R9) - rhs.error() not moved when it should be?
From: Emile Cormier (emile.cormier.jr_at_[hidden])
Date: 2020-10-06 15:44:10


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



STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups