Multiple implicit type converters

Bahman Movaqar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 11 12:34:41 PDT 2015


On Friday, 11 September 2015 at 16:33:52 UTC, Meta wrote:
> The only ways to get implicit conversion between two types in D 
> are through `alias this`, inheritance, or implementing an 
> interface.

That's enough for me, I suppose.
I am thinking of having a family of functions in my 
structs/classes as `as` family, such as `asDouble`, `asFooBar`.




More information about the Digitalmars-d-learn mailing list