Вы можете использовать std::bind
для преобразования N-арной функции в унарный объект функции.
using std::placeholders::_1;
evaluate(sm, std::bind(some_function, _1, other, arguments));
std::bind
в C ++ 11, но в старых компиляторах вполне вероятно, что TR1включен, где вы можете использовать std::tr1::bind
, и, наконец, еще есть Boost.Bind.
Или вы можете создать объект функции самостоятельно:
struct SomeFunctor
{
SecondType arg2;
ThirdType arg3;
SomeFunctor(cosnt SecondType& arg2, const ThirdType& arg3)
: arg2(arg2), arg3(arg3)
{}
ResultType operator()(const FirstType& arg1) const
{
return some_function(arg1, arg2, arg3);
}
};
evaluate(sm, SomeFunctor(other, arguments));
// ^ construct SomeFunctor with arg2=other, arg3=arguments