((CComp*)glut.get_first_object(obj_comp))->func();get_first_object(type) is a member function of my wrapper class that returns a CObject*. CObject is a base class from which all the game objects derive. If I want to access a function from a derived class I have to first cast the pointer to the object then use the -> operator.
My question is: how can I get around this clumsy syntax? Ideally I'd like to have something like the following:
glut.get_first_object<CComp>(obj_comp)->func();However I can't use templates as the function is a class member.
This post has been edited by PlasticineGuy: 29 June 2011 - 12:06 AM