let\'s say i want to have a member variable for a pointer to std::vector but i do not want to specify what type of variable it stores. I want to access only those functions that
You could do this:
class vector_container_base
{
public:
~vector_container_base() {}
virtual std::size_t size() const = 0;
};
template
class vector_container :
public vector_container_base
{
public:
typedef std::vector vector_type;
std::size_t size() const
{
return mVector.size();
}
private:
vector_type mVector;
};
And so on, but I doubt this is too useful in any real situation.