template class ObjectFactory; template BaseClassType CreateObject() { return new ClassType(); } template class ObjectFactory { protected: typedef BaseClassType (*CreateObjectFunc)(); public: ... BaseClassType Create(UniqueIdType unique_id) { ... return ((*iter).second)(); } ... protected: ... }; template BaseClassType CreateObject(Param1Type param1) { return new ClassType(param1); } template class ObjectFactory { protected: typedef BaseClassType (*CreateObjectFunc)(Param1Type); public: ... BaseClassType Create(UniqueIdType unique_id, Param1Type param1) { ... return ((*iter).second)(param1); } ... protected: ... }; template BaseClassType CreateObject(Param1Type param1, Param2Type param2) { return new ClassType(param1, param2); } template class ObjectFactory { protected: typedef BaseClassType (*CreateObjectFunc)(Param1Type, Param2Type); public: ... BaseClassType Create(UniqueIdType unique_id, Param1Type param1, Param2Type param2) { ... return ((*iter).second)(param1, param2); } ... protected: ... };