Medium
Three ways to declare a destructor that does nothing
Which of these three types satisfy std::is_trivially_copyable, the property that sanctions copying them with memcpy and makes them eligible for the memmove fast paths in std::copy and vector reallocation?
main.cpp
#include <type_traits>
struct A { int x; }; // no destructor declared
struct B { int x; ~B() = default; }; // defaulted on first declaration
struct C { int x; ~C() {} }; // user-provided, empty body
// Which of these assertions hold?
static_assert(std::is_trivially_copyable_v<A>);
static_assert(std::is_trivially_copyable_v<B>);
static_assert(std::is_trivially_copyable_v<C>);34 of 44 in Compilers