template <class M, class A> class C { std::list<M> m_List; ... }
Is the above code possible? I would like to be able to do something similar.
Why I ask is that i get the following error:
Error 1 error C2079: 'std::_List_nod<_Ty,_Alloc>::_Node::_Myval' uses undefined class 'M' C:\Program Files\Microsoft Visual Studio 9.0\VC\include\list 41
My guess: you forward declared class M somewhere, and only declared it fully after the template instantiation.
My hint: give your formal template arguments a different name than the actual ones. (i.e. class M)
Example of a bad forward declaration, resulting in the mentioned error:
Example of proper declaration, not resulting in the error: