Why I avoid using `default` and inline functions in my class declarations
Sure, = default
is great and convenient especially for destructors and other
special member functions but when declaring a class that’s meant to be a part
of a shared library’s interface I try to avoid using it and here’s my reasons
why.
TLDR
= default
or include inline
definitions in class’s header file to avoid
vtable/symbols duplication across compilation targets that use the header.Problem definition
Let’s start with a simple abstract class declared in a header file (calc.hpp
):