I\'m trying to eliminate an overload from an overload set if operator+= is missing.
I know how to check if T+T is legal :
t
I would write the second form as:
template
auto foo(T a, T b, ...) -> decltype( a+=b, void() )
{
a += b;
}
The deduced type for decltype(a+=b, void()) would be just void if the expression a+=b is valid, else it would result in SFINAE.
Well, even in the first form, I would use the trailing-return type approach.