I am using private inheritance to model my has-a relationship, but my base class type is rather complicated (well, a little bit), and I would like to have a typedef for it. Is something like the following possible in C++
struct S : private typedef std::vector<int> Container {};
Currently I am doing:
template< typename Container = std::vector<int> >
struct S : private Container {};
But this
- makes my class to a template class. This is not a big problem for my current application (since it is a template class anyway), but in general is not nice.
- could lead to bugs, when people think they are allowed to specify their own container.