为什么is_copy_assignable()
在这里返回 false (g++ 4.8.2):
#include <iostream>
#include <utility>
#include <type_traits>
using namespace std;
class thing {
public:
int n;
thing () : n(1) { }
thing (thing& x) : n(x.n) { }
thing& operator= (thing& x) {
n = x.n;
return *this;
}
};
using namespace std;
int main (void) {
cout << is_copy_assignable<thing>::value << endl;
return 0;
}