On Monday, 18 January 2021 at 19:02:10 UTC, Adam D. Ruppe wrote:
On Monday, 18 January 2021 at 18:40:37 UTC, Jack wrote:
isInstanceOf from std.traits seems to not work with class the
way I need to. I'd like to make a template function accepts
only class of a specified class type
class A { }
class B : A { }
class C : A { }
int f(T)(in A[int] arr)
Use
if(is(T : A))
the syntax there is similar to the class declaration itself.
is that sytax derived from there?
isInstanceOf is for checking instances of templates rather than
classes.
I see
Thanks!