C++ 函数调用性能 Performance Caveats of Passing Functions as Arguments in C++ 本文比较了在C++中使用函数指针、std::function和lambda函数作为参数传递的性能,发现std::function不如函数指针和lambda函数高效。对于频繁调用的快速计算函数,应避免使用std::function以获得最佳性能。 C++ lambda函数 std::function 函数指针 函数调用 性能