Type aliasing

Adam D. Ruppe destructionator at gmail.com
Tue Dec 4 08:42:20 PST 2012


On Tuesday, 4 December 2012 at 16:34:50 UTC, js.mdnq wrote:
> class myclass {
>    int ID;
> }

Try something like this:

class myclass {
    typeof(uniqueID!T.Get()) ID;
    this() {
      ID = uniqueID!T.Get();
    }
}


The typeof(expr...) can be used anywhere a type can be used.


More information about the Digitalmars-d-learn mailing list