I'm having an issue with passing templates through pointers, I managed to simplify the issue to this.
So I have a simple template,
Which I run through,Code:template<class T> class List { public: T* Arg1; List(T* first){Arg1=first;} };
The count in GetChildren gets me 1(the correct result), whereas the count in Test gets me a number that's way off (-45030200 or something along those lines).Code:void GetChildren(ListProperties &properties) { List<CPtrList> *list = new List<CPtrList>(properties.children); int count = list->Arg1->GetCount(); Test(list); } void Test(void *list) { List<CPtrList>* newList = (List<CPtrList>*)list; int count = newList->Arg1->GetCount(); }
Can anyone shed some light on where the problem might be?


Reply With Quote

Bookmarks