c++: derive from templated class