2 つの std::maps をマージする次のコードがあります。
template <typename key, typename value>
void merge_maps(std::map<key, value>& one, const std::map<key, value>& another,
boost::function2<value, value, value> aggregate)
{
// MERGING. aggregate is called if key exists in both maps
}
このような構造体があります。
struct foo {
int bar;
foo operator+(const foo& other) const;
};
std::map<std::wstring, foo> one, another
を使用foo::operator+
して渡した2 つをマージしようとしましboost::lambda
たが、コンパイル エラーが発生しました。
merge_maps(one, another, _1+_2); // MSCV9.0 cannot deduce template argument for lambda there
お願い助けて。私が間違っていることは何ですか?