On Monday, 7 May 2012 at 09:18:11 UTC, David Nadlinger wrote:

Doing it without a separate factory function (and maybe disabling new along with it by protecting the constructor) is not possible in D.

Okay that answers my question then.

However, I don't quite see what it would gain you in the first place – besides potentially screwing up the semantics users expect from new…

It's a similar thing as when you override new's memory allocation part... yes, it can screw up the semantics, but it's assumed you know what you're doing...

Reply via email to