#include <type_traits>
class Test
{
public:
Test(const Test &) = delete;
Test &operator=(const Test &) = delete;
};
void fn(Test &a, const Test &b) { a = b; }
static_assert(!std::is_copy_assignable<Test>::value, "Test shouldn't be assignable");
Compiling this under MSVC 2013 Update 3 unexpectedly fails the static_assert
, and the function fn
fails to compile (as expected.) This is contradictory, right?
Am I misusing is_copy_assignable
? Is there another way to test for this condition?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…