SImple C++ code to D

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 15 07:46:00 PDT 2014


Alexandre:

> 	RefCounted!(DWORD) addr;

I think RefCounted is for advanced usages in D :-)


> template Wrap(T)
> {
> 	struct Wrap
> 	{
> 		T val;
> 		this(T val){val = val;}
> 	}
> }

Simpler:

struct Wrap(T) {
     T val;
     this(T val_) { this.val = val_; }
}


Or just:

struct Wrap(T) { T val; }

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list