C++ Logo

std-discussion

Advanced search

Re: Deleting the Rvalue member function

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Fri, 30 Dec 2022 12:50:09 +0000
On Wednesday, December 28, 2022, Matthew House via Std-Discussion <
std-discussion_at_[hidden]> wrote:

>
> Meanwhile, Dog::operator& is a viable function for &move(d), since a
> reference of type const volatile Dog&& can bind directly to xvalue
> move(d). Therefore, overload resolution selects Dog::operator& for
> &move(d), resulting in an error, since the function is defined as
> deleted.
>



Do you reckon it should be a compiler error to delete the unary '&'
operator for Rvalues? Should I post to the proposals group to make it a
compiler error in C++26?

Received on 2022-12-30 12:50:12