开发者

C++ std::map s as arguments

Is it possible for me to take an argument of any type of std::map?

void myFunct开发者_JAVA技巧ion(const std::map<std::string,[INSERT_ANY_CLASS]>& tMap);


Yes, you can make it a function template:

template<class T>
void myFunction(const std::map<std::string,T>& tMap);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜