I\'m trying to eliminate an overload from an overload set if operator+= is missing.
operator+=
I know how to check if T+T is legal :
T+T
t
You need an lvalue on the left hand side of += but your solution has an xvalue. As dyp has stated in the comments, you can use declval to get an lvalue. This works fine (just tested it):
lvalue
+=
declval
template() += std::declval())> void foo(T a, T b, ...) { }