Can somebody explain the need for
private template isSame(alias a, alias b)
{
static if (!is(typeof(&a && &b)) // at least one is an rvalue
&& __traits(compiles, { enum isSame = a == b; })) // c-t comparable
{
enum isSame = a == b;
}
else
{
enum isSame = __traits(isSame, a, b);
}
}
when there is already
__traits(isSame, a, b)
?
Are there any cases where
__traits(isSame, a, b)
doesn't have the same value as
a == b
provided the static if expression above is true.