Q:

C++ Using pointers to template objects

I have a class named ABC which has a class template:
template <class T> class ABC{}

In another class I am trying to store of objects ABC in a list:
class CDE{
private:
  list<ABC *> some_list; 
}

I intend to store objects of ABC which might have different class template parameters. Is it necessary to specify template even for a pointer at compile time? What if the container is supposed to store objects of different type? Is that not possible?

A:

Is it necessary to specify template even for a pointer at compile time ?

Yes.

What if the container is supposed to store objects of different type ? Is that not possible ?

It is not (directly) possible.
There is no such thing as the class ABC.  There are only instantiations of ABC, such as ABC<Foo> and ABC<Bar>.  These are completely different classes.
You can do something like:
template<typename T>
class ABC : public ABC_Base
{
  ...
}

list<ABC_Base*> some_list;

By doing this, all of your ABC instantiations have a common base type, and you can use a base pointer arbitrarily.

