digitalmars.D.learn - Comparing variants
- rumbu (19/19) May 10 2015 Comparing integer signed and unsigned variants will result in
Comparing integer signed and unsigned variants will result in
error:
import std.variant;
void main()
{
auto a = 11;
auto b = 10u;
assert(a > b);
Variant va = 11;
Variant vb = 10u;
assert(va > vb); //error
}
std.variant.VariantException std/variant.d(1309): Variant:
attempting to use incompatible types int and uint
Is this intended behaviour? I'm asking because the rest of
arithmetic/equality operations are working as expected, only
opCmp throws.
May 10 2015








"rumbu" <rumbu rumbu.ro>