[DDMD] Reasoning behind converting new Type -> Type::create

Daniel Murphy yebbliesnospam at gmail.com
Mon Jan 27 07:00:40 PST 2014


"Iain Buclaw"  wrote in message news:tahhleknrghaegcdvfgz at forum.dlang.org...

> Question aimed at Daniel.

> Assuming this needs to be done for all new'ing of classes across C++ -> D, 
> it looks like you've only done half a job?  Surely you should define a 
> ::create for all Type's on the chance that the backend might *actually* 
> need it irrespective of what DMD does?

Yeah, for now you can't new anything from C++ that's written in D.  You also 
can't stack-allocate if it has a constructor and destructor.  I'm not 
expecting these limitations to go away any time soon.  This applies to 
pretty much every struct/class except OutBuffer.

I didn't want to introduce new dead code.  It should be trivial to add more 
methods if you like, or it can wait until you start building DDMD and get 
linker errors!

> I guess this means that things would be broken if I switched to DDMD 
> today... =)

There are probably a couple of other things too, but there shouldn't be 
anything non-trivial.

Maybe tomorrow? 



More information about the Digitalmars-d mailing list