Sometimes it can be an annoyance that c++ defaults to allow slicing. For example
struct foo { int a; }; struct bar : foo { int b; }; int main() { bar x{1,2
You can prevent the base from being copied outside of member functions of derived classes and the base itself by declaring the copy constructor protected:
struct foo { // ... protected: foo(foo&) = default; };