DIP 52 - Implicit conversions
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Fri Dec 13 02:39:30 PST 2013
On 13/12/13 01:23, IgorStepanov wrote:
> You can write something like:
>
> void acceptMyType(T)(T arg) if(is(T == MyType))
> {
> ...
> }
>
> Yes, this way is complex, but this situation is rare and we can put up with it.
Yes, that's exactly the method I was thinking of. I really found it very
beautiful when I saw it inside std.bigint and realized what it was meant to do,
but I think it's _very_ prone to being accidentally "corrected" on the
assumption that it's meant to be is(T : MyType).
More information about the Digitalmars-d
mailing list