Template <class T>
Inline static void dumpvector (const STD: vector <t *> & vvector)
{
STD: vector <t * >:: iterator pvectorit = vvector. Begin ();
For (; pvectorit! = Vvector. End (); pvectorit ++)
{
(* Pvectorit)-> dump ();
}
}
The above statement in VC can be passed. When using the template iterator in GCC, a compilation error occurs. It seems that the type does not match, but the iterator prototype is not used directly. As follows:
Template <class T>
Inline static void dumpvector (const STD: vector <t *> & vvector)
{
_ Gnu_cxx ::__ normal_iterator <t * const *, STD: vector <t *, STD: Allocator <t *> pvectorit = vvector. Begin ();
For (; pvectorit! = Vvector. End (); pvectorit ++)
{
(* Pvectorit)-> dump ();
}
}
The specific reason is unknown. I think it is because the macro definition does not contain the corresponding macro definition, or the macro definition does not support the template. I will study it later. Pai_^