这条线:为什么在拆分为2行时不工作?
std::auto_ptr<Ogre::Root> lRoot (new Ogre::Root(lConfigFileName, lPluginsFileName, lLogFileName));
工作正常。 但是当我这样做是没有:
std::auto_ptr<Ogre::Root> lRoot;
lRoot (new Ogre::Root(lConfigFileName, lPluginsFileName, lLogFileName));
,并上报:error: no match for call to ‘(std::auto_ptr<Ogre::Root>) (Ogre::Root*)’
据我有限的了解去不应将这些做同样的事情?或者我错过了一些重要的东西?
上次我检查,Ogre有它自己的智能指针类。你为什么不使用它们?无论如何,'auto_ptr'已被弃用。忘掉它。 – n0rd 2013-03-04 21:54:05
这就是OGRE教程告诉我如何做xD的原因,我只是重构了一下代码。 – w4etwetewtwet 2013-03-04 21:55:34