   Problem with typedefs and templates in C++
  I have this code:template <class T> class ParameterContainer{public:ParameterContainer();T * parameterarray;int sizeparameterarray;};ParameterContainer::ParameterContainer(){sizeparameterarray = 0;parameterarray = 0;}typedef bool (*pointertoFunc) (ParameterContainer);Now, what I want is to make ParameterContainer a class template and let pointertoFunc be a type that accepts a pointer to a function that returns a bool and accepts a ParameterContainer as a parameter. (I will do a special implementation of <char> ParameterContainers, btw.)But Visual C++ complains that I need to use a parameter list to use class templates. How can I fix this or am I doing this in an utterly dumb way?-MentalMan   
  A function cannot accept ParameterContainer as a type. ParameterContainer is not a type. It is a template. ParameterContainer<Something> is a type.   ;  You are very close.  When you define your contructor (or any other function) you need to specify that it its templated.  Secondly, when you are trying to typedef your function pointer you need to provide a concrete class for the template.template <class T> class ParameterContainer{public:ParameterContainer();T * parameterarray;int sizeparameterarray;};template <class T>ParameterContainer<T>::ParameterContainer(){sizeparameterarray = 0;parameterarray = 0;}typedef bool (*pointertoFunc) (ParameterContainer<int>);Alan   ;  You could also put the typedef in the namespace of the class, like this:template <class T> class ParameterContainer{public:   typedef bool (*pointertoFunc)(ParameterContainer<T>);   ...};// use typedefParameterContainer<int>::pointertoFunc pFoo; [Edited by - spoulson on January 19, 2006 3:59:38 PM];  Ok. Thanks everyone. I'll just use another way to approach this problem.   