inherit primitives in c++