Date: Fri, 4 Jul 2025 11:09:20 +0200
On Fri, Jul 04, 2025 at 09:36:01AM +0100, Frederick Virchanza Gotham via Std-Proposals wrote:
> And so then the compiler error would tell the programmer exactly why
> they can't use it. I'd also like to see the same kind of thing for
> when a method is 'delete'ed, e.g.:
>
> MyClass::MyClass(MyClass &&) = delete
> [[explain : delete : "This constructor is deleted because you
> cannot move a "
> "synchronisation object without affecting
> other threads "
> "that may be waiting on it " ]];
We already have
MyClass::MyClass(MyClass &&) = delete("This constructor is delete because ...");
in C++26.
Christof
> And so then the compiler error would tell the programmer exactly why
> they can't use it. I'd also like to see the same kind of thing for
> when a method is 'delete'ed, e.g.:
>
> MyClass::MyClass(MyClass &&) = delete
> [[explain : delete : "This constructor is deleted because you
> cannot move a "
> "synchronisation object without affecting
> other threads "
> "that may be waiting on it " ]];
We already have
MyClass::MyClass(MyClass &&) = delete("This constructor is delete because ...");
in C++26.
Christof
-- https://cmeerw.org sip:cmeerw at cmeerw.org mailto:cmeerw at cmeerw.org xmpp:cmeerw at cmeerw.org
Received on 2025-07-04 09:09:24