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).
Compiler Explorer link: https://compiler-explorer.com/z/q59nzrzr4