invoke是C++17标准引入的一个函数模板,用来调用可调用对象(Callable Object,如函数指针、函数对象、成员函数指针等)并返回结果。 invoke提供了统一的调用语法,无论可调用对象的类型是什么,都可以使用同一种方式进行调用。 详见:https://en.cppreference.com/w/cpp/utility/functional/invoke 在C++17之前,调用不同类型...
g++ test.cpp -o main Can you provide a small but working code example? here is the simplest example online: godbolt What is the expected behavior? compile pass And what is the actual behavior instead? compiler error Which compiler and operating system are you using?
invoke是C++17标准引入的一个函数模板,用来调用可调用对象(Callable Object,如函数指针、函数对象、成员函数指针等)并返回结果。 invoke提供了统一的调用语法,无论可调用对象的类型是什么,都可以使用同一种方式进行调用。 详见:https://en.cppreference.com/w/cpp/utility/functional/invoke 在C++17之前,调用不同类型...