From: Mark J. <sn...@sn...> - 2001-01-04 22:19:44
|
/* Hi, I've reported this GCC bug, but I thought I'd better post it here too in case there are people around who could fix gcc or tell me my code is wrong :-) Compile with g++ -c, should get an internal compiler error #373. Cheers, Mark Jordan. */ namespace DOC { template <typename CharT> class Doc { }; template <typename CharT,typename DocT> Doc<CharT>* MakeDocument() { return new DocT; } template <typename CharT> class DocTemp { public: typedef Doc<CharT>* (*PFM)(); void FactoryMethod( PFM p ) { m_p=p; } private: PFM m_p; }; } template <typename CharT> class MyDoc : public DOC::Doc<CharT> { }; int main(int argc, char *argv[]) { DOC::DocTemp<char> t; t.FactoryMethod( DOC::MakeDocument<char,MyDoc<char> > ); return 0; } |