The std::invoke function does more than invoke functions

536 · Raymond Chen · April 1, 2022, 2:21 p.m.
The std::invoke function in the C++ standard library is usually used to call a functor with parameters. std::function<void(int)> func = ...; // same as func(42) std::invoke(func, 42); What std::invoke brings to the table is that you can use it for other things beyond just functors. The post The <CODE>std::invoke</CODE> function does more than invoke functions appeared first on The Old New Thing....