You could wrap this up into: bool variantValuesDiffer(lhs, rhs)