proposed @noreturn attribute
Vladimir Panteleev via Digitalmars-d
digitalmars-d at puremagic.com
Sat Jul 8 14:03:57 PDT 2017
On Saturday, 8 July 2017 at 12:17:57 UTC, Andrei Alexandrescu
wrote:
> @disable @property None init();
You meant static here I guess.
> The compiler detects (without having anything hardwired about
> the particular type "None") that the type None is impossible to
> create and copy/move from a function, and therefore decrees the
> function will never return.
Cheat: https://is.gd/pf25nP
Works because of NRVO I guess. This particular one is countered
by also adding a disabled destructor.
More information about the Digitalmars-d
mailing list