【发布时间】:2009-05-06 09:17:14
【问题描述】:
我有这样的课:
class MyClass{
public:
MyClass(int Mode);
private:
std::map < int, std::string, CompFunc > data;
};
数据成员必须根据Mode参数使用不同的比较函数。
if Mode == 1, then use CompFunc1.
if Mode == 2, then use CompFunc2.
etc.
但是 CompFunc 模板参数是固定在那里的,我怎么能动态地使它呢?
谢谢。
【问题讨论】:
标签: c++ visual-c++