Compare type with another at CT

Frustrated c1514843 at drdrb.com
Thu Jan 23 08:21:38 PST 2014


I am trying to compare a type with another type at compile time.

My code is

class Q(T)
{
	static auto foo()
	{
		static if (T is A)
		{
                      ...
		}
		static assert(0, "error");
	}
}

and get the error "cannot interpret A at compile time" on the
static if line.

A is an interface.

I simply want to determine if a type is derived from another type
at compile time.


More information about the Digitalmars-d-learn mailing list