I have a class like the following:
class C {
public:
C() : ... {}
~C() {}
Member_1 m_1;
// ...
Member_N m_N;
};
The two special member functions shown are the only ones declared.
Now,
static_assert(std::is_nothrow_move_assignable<Member_1>::value);
// ...
static_assert(std::is_nothrow_move_assignable<Member_N>::value);
are all satisfied. Yet,
static_assert(std::is_nothrow_move_assignable<C>::value);
asserts. If I remove the empty destructor, it passes.
What does the destructor have to do with the move assignment operator? New Rule of Five?
Compiler is GCC 4.9.3 with -std=c++0x
(for historic reasons).
Aucun commentaire:
Enregistrer un commentaire