'new' class method

Bill Baxter wbaxter at gmail.com
Thu Oct 23 14:32:17 PDT 2008


On Fri, Oct 24, 2008 at 6:28 AM, Sergey Gromov <snake.scaly at gmail.com> wrote:
> Fri, 24 Oct 2008 05:31:44 +0900,
> Bill Baxter wrote:
>> But, ok, this isn't Python so we have to have a story for placement new.
>> I believe use of placement new is pretty rare.  (I use it rarely,
>> anyway. :-) )   If so it should be ok if the syntax is a little
>> clunky.
>
> Maybe do it with a library function?
>
> auto c = core.intrinsic.construct!(C)(addr, ctor_arg0, ctor_arg1);

The current placement new in D can take an arbitrary list of args.  So
you have two lists -- new_args and ctor_args.

--bb



More information about the Digitalmars-d mailing list