Defining a custom *constructor* (not initializer!)

David Nadlinger see at klickverbot.at
Mon May 7 02:18:09 PDT 2012


On Monday, 7 May 2012 at 07:28:18 UTC, Mehrdad wrote:
> Is this something that actually modifies the 'new' operator, or 
> is it just a separate factory function that my code would need 
> to switch to using?

Doing it without a separate factory function (and maybe disabling 
new along with it by protecting the constructor) is not possible 
in D. 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…

David


More information about the Digitalmars-d mailing list