One Destructor Costs You Two

struct Widget {
    std::vector<int> data;      // 10 million elements
    ~Widget() { log("destroyed"); }
};

Widget make();
Widget w1 = make();
Widget w2 = std::move(w1);

Widget declares nothing but a destructor. More than one statement below is true. Select every true one.

A

std::move(w1) fails to compile, because there is no move constructor to bind the rvalue to.

B

Writing ~Widget() = default; instead avoids the suppression, because a defaulted destructor is not user-declared.

C

The move assignment operator is suppressed by the same user-declared destructor.

D

No move constructor is declared, so Widget w2 = std::move(w1); compiles and performs a full copy of all 10 million elements.

E

The copy constructor is still implicitly declared and defaulted, though the standard deprecates that declaration.

F

The copy constructor is implicitly deleted, since a class with a user-declared destructor is no longer trivially copyable.