+9  A: 

Typically this is done by your template inheriting from an interface class, IE:

template <class T> class Dendrite : public IDendrite
{
        public:
                Dendrite()
                {
                }

                virtual ~Dendrite()
                {
                }

                void Get(std::vector<T> &o) = 0;

        protected:
                std::vector<T> _data;
};

and then you're IDendrite class could be stored as pointers:

std::vector<IDendrite*> m_dendriteVec;

However, in your situation, you are taking the template parameter as part of your interface. You may also need to wrap this also.

class IVectorParam
{
}

template <class T>
class CVectorParam
{
    std::vector<T> m_vect;
}

giving you

class IDendrite
{
   ...
public:
   virtual ~IDendrite()
   virtual void Get(IVectorParam*) = 0; 
}

template <class T> class Dendrite : public IDendrite
{
  ...
  // my get has to downcast to o CVectorParam<T>
  virtual void Get(IVectorParam*);
};
Doug T.
A: 

Yes it is possible. Just make sure to provide virtual functions, and virtual destructor. In addition, you can use typeid to get the actual type (as well as dynamic_cast to check the type)

vehomzzz
A: 

Your code may working if you do like this : Please ensure design aspects yourself

template <class T> class Dendrite
{
        public:
                Dendrite()
                {
                }

                virtual ~Dendrite()
                {
                }

                virtual void Get(std::vector<T> &o) = 0;

        protected:
                std::vector<T> _data;
};

template<class T>
class derived:public Dendrite<T>
{
    public:
     derived(){};
     void Get(std::vector<T> &o)
     {
      std::cout<<"This is a test"<<std::endl;
     }
};

int main()
{


    std::vector<Dendrite<int>*> vec;
    Dendrite<int> *ptr=new derived<int>();
    vec.push_back(ptr);
    std::vector<int> testVec;
    vec[0]->Get(testVec);
}
sat
You missed the point; now you are forcing every element to be int-type.
nhaa123