[Issue 12597] Payload getter for std.typecons.Typedef

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 26 03:07:25 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12597

--- Comment #15 from bearophile_hugs at eml.cc ---
(In reply to bearophile_hugs from comment #14)

> > auto typedefVal(T)(T val)
> > {
> >     return cast(TypedefType!T)val;
> > }
> 
> Yes, this ER asks for such safe function in Phobos.

But it's better to add a template constraint to that T to be sure it's a
Typedef.

--


More information about the Digitalmars-d-bugs mailing list