Daily bit(e) of C++ | std::invoke
Daily bit(e) of C++ #236, The C++17 utility that can invoke any callable: std::invoke.
The C++17 std::invoke is a utility that can invoke any callable with the provided arguments. Note that this includes member functions and even members.
If we don't need the type erasure properties of std::function or std::move_only_function, std::invoke can be a lower-level alternative (with the callable and arguments statically deduced).
thanks!