Use function pointer rather than std::function.