On 2012-05-07 18:01, Mehrdad wrote:
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.
No, have a look at this example: http://pastebin.com/UV5R82dgA bit of a hack. An other option would to use a separate public method that acts as a constructor.
-- /Jacob Carlborg