【发布时间】:2014-12-27 07:33:08
【问题描述】:
我得到了一个函数,它从给定向量中返回最小值为
float minValue(vector<int> v){
auto it = min_element(v.begin(), v.end());
return *it;
}
现在我有一张类似的地图
map<std::string, function*>
{
{"min", /* here I need to use the above function call*/},
//similarly for other requirements too
{""}
}
如何使用键指向函数指针映射值?
【问题讨论】:
标签: c++ map function-pointers