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://lnkd.in/eYdPM7Nr #cpp #cplusplus #coding #programming #dailybiteofcpp
Like C# delegates
Juan Antonio Herreros Bragado
Just don't use if if the return is none-const reference.