C++ standalone: use template inheritance to simplify