Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Ogre::any_cast<std::map<Rail>::iterator>
它需要Ogre::any_cast<std::map<Rail>并且说的参数太少等。我该如何解决它(除了明显的 typedef 别名)?
Ogre::any_cast<std::map<Rail>
问题是它std::map至少需要两个模板参数——键类型和值类型。目前你有std::map<Rail>. 你映射Rail到什么?例如,如果您的迭代器适用于从tostd::map映射的 a (假设不是推导类型),这将是可以的:RailintRail
std::map
std::map<Rail>
Rail
int
Ogre::any_cast<std::map<Rail,int>::iterator>(some_any_object)