SImple C++ code to D

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 14 10:04:57 PDT 2014


Alexandre:

> void InjectData(T)(ref T BaseSrc, string data)
> {
> 	memcpy(&BaseSrc, data.ptr, data.length);
> }
>
> It's possible to improve this function ?

You can add some modifiers (like @nogc for dmd 2.066), and the 
name of D functions starts with a lower case.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list