On 30 March 2011 11:30, Mahmood Naderan wrote: > I rewrte the neccessary funtion definitions again to be clear: ... > static API::conf_object_t * constructor(API::parse_object_t * aParseObject) { OK, this is a static function, that's what I was asking. > template <class CppObjectClass > > class Factory { > typedef Class<CppObjectClass> class_; > class_ * theClass; > public: > Factory() { > static class_ theStaticClass; > theClass = &theStaticClass; > } > typename class_::object_type create(std::string aSimName) { > API::conf_object_t * object = aux_::NewObject_stub( > const_cast<API::conf_class_t *>( theClass->getSimClass() ), aSimName, > theClass->constructor); What if you change theClass->constructor to &class_::constructor instead?