Tests if the algebraic type stores a value of a certain data type.
1 union Fields { 2 int number; 3 string text; 4 } 5 6 TaggedAlgebraic!Fields ta = "test"; 7 8 assert(ta.hasType!string); 9 assert(!ta.hasType!int); 10 11 ta = 42; 12 assert(ta.hasType!int); 13 assert(!ta.hasType!string);
See Implementation
Tests if the algebraic type stores a value of a certain data type.