#include
class Test
{
public:
Test(const Test &) = delete;
Test &operator=(const Test &) = delete;
};
void fn(Test &a,
You are correct this is a bug: https://connect.microsoft.com/VisualStudio/feedback/details/819202/std-is-assignable-and-std-is-constructible-give-wrong-value-for-deleted-members
I took cplusplus.com's is_copy_assignable code:
#include
#include
struct A { };
struct B { B& operator= (const B&) = delete; };
int main() {
std::cout << std::boolalpha;
std::cout << "is_copy_assignable:" << std::endl;
std::cout << "int: " << std::is_copy_assignable::value << std::endl;
std::cout << "A: " << std::is_copy_assignable::value << std::endl;
std::cout << "B: " << std::is_copy_assignable::value << std::endl;
return 0;
}
And tested it on Visual Studio 2013 and got:
is_copy_assignable:
int: true
A: true
B: true
On gcc 4.8.1 I got:
is_copy_assignable:
int: true
A: true
B: false
Notably on the Visual Studio 2015 Beta this is fixed. I get:
is_copy_assignable:
int: true
A: true
B: false
How do you feel about betas ;)