Ok, I'm using polymorphism to abstract a templated class from the un-templated base class in order to create a template in template structure. This is so I can leave the sub-template objects open to determination until later, rather than defining them upon declaration of the primary structure, defeating the purpose of making them templated.
So I have my (untemplated) GUI class, and my (templated) GUIT class. I have created a "GUILIST" Linked List, declared as a List of "GUI" objects, but add "GUIT" objects to the list through polymorphism so each GUILIST object can handle a different templated type. It looks like this:
GUILIST.Add(new GUIT(Parent, GUIwindow, &floatvar, 0, 100));
My problem is with the "Parent" Parameter. I want each GUILIST element (should be GUIT objects) to have a member called "Parent" that points to another GUILIST element (a Parent GUIT object), and it should be passed in as a param in the constructor, like above. The problem is that the GUILIST items are *technically* (untemplated) 'GUI' objects, because that's what the GUILIST was declared as, but they are *really* (templated) 'GUIT' objects by polymorphism.
I just can't seem to make the compiler happy with what I pass in, and was hoping to get some help. My example error was that I just tried passing in "GUILIST.GetLast()" (returns pointer to last list element) as the "Parent" parameter and get the error:
cannot convert parameter 1 from 'class GUI *' to 'class GUIT *'
I can see why it would have the problem, but I can't figure out how to fix it. Thanks for any help