C++ Template Inheritance and Copy Construction: A Puzzling static_assert

This article explores a puzzling issue regarding copy constructors in C++ template inheritance. The `Derived` class inherits from `Base`, where `Base`'s copy constructor is deleted. However, `Derived` defines its own copy constructor. Even though this constructor attempts to copy the uncopyable `Base` object, `std::is_copy_constructible` still returns true. This is because the compiler only checks for the presence of a non-deleted copy constructor, not its instantiability. The author further discusses the differences between explicitly defined and implicitly defined copy constructors, and the implications of moving the copy constructor definition out of line.
Read more