defining destructor in a class derived from move-only type gives compile-time error when created with emplace_back or push_back of std::vector
Verify your expectations of CopyConstructible and MoveConstructible with static_assert
s:
static_assert(!std::is_copy_constructible<A>{});
static_assert( std::is_move_constructible<A>{});
static_assert(!std::is_copy_constructible<B>{});
static_assert(!std::is_move_constructible<B>{});
When ~B()
is declared, the compiler implicitly deletes B(B&&)
. You can override that behavior with an explicit declaration:
B(B&&) = default;