function argument restrictions for templated struct

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 7 09:27:20 PDT 2015


On Monday 07 September 2015 17:51, Laeeth Isharc wrote:

> Is there a more elegant way to write the template arg 
> restrictions for display?
[...]
> void display(T)(T a)
> if (__traits(isSame, TemplateOf!(T), Bar))
> {
> 	writefln("%s",a);
> }

if (isInstanceOf!(Bar, T))


More information about the Digitalmars-d-learn mailing list