I am trying to inherit the std::vector
class template into my membvec
class template as public
. And I want to use it as e.g. say membvec<float> mymemb(10)
with the intention of creating my membvec
variable mymemb
containing 10
elements.
But I can't figure out how to write the templatised declaration of the public
inheritance. What I am doing is the following, but all in vain.
template <typename T, template <typename T> class std::vector = std::vector<T>>
//error above: expected '>' before '::' token
class membvec: public std::vector<T>
{
const membvec<T> operator-() const; // sorry the previous version was a typo
//error above: wrong number of template arguments (1, should be 2)
...
};