Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AK: Fix "assignment from temporary" check of
Optional::operator=
There was an existing check to ensure that `U` was an lvalue reference, but when this check fails, overload resolution will just move right on to the copy asignment operator, which will cause the temporary to be assigned anyway. Disallowing `Optional<T&>`s to be created from temporaries entirely would be undesired, since existing code has valid reasons for creating `Optional<T&>`s from temporaries, such as for function call arguments. This fix explicitly deletes the `Optional::operator=(U&&)` operator, so overload resolution stops.
- Loading branch information