Clang compiles this fine, but GCC and MSVC complain that operator=
cannot be defaulted:
#include <type_traits>
template<class T>
struct S
{
typedef typename std::enable_if<!std::is_enum<T>::value, S>::type Me;
S &operator=(Me const &) = default;
};
int main()
{
S<int> s1, s2;
s1 = s2;
}
Is this code legal? If not, would it be legal if Me
had been defined as typedef S Me;
?
>;`> Me;`