class Base
{
public:
Base(Base&&) = default;
};
class Derived: public Base
{
public:
Derived(Derived&&) = default;
};
int main()
{
static_assert(std::is_nothrow_move_constructible_v<Derived>, "Error noexcept");
}
In this code even if neither Derived nor Base declared move constructor noexcept
but still this passes static assert on std::is_nothrow_move_constructible_v<Derived>
.
Why?