www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - checkedTo

I often write snippets like this for narrowing numerical conversions.

debug
     return to!T(exp);
else
     return cast(T)exp;

How about adding a construct for this to std.conv?
Could be checkedTo!T(val).

martin
Nov 02 2011