核心内容摘要
cursor太贵?试试gpt的代码工具,Codex Windows 版本上线了,下载安装完整教程,免费使用gpt写代码
json array里面可以保存不同类型的数据,那么我们可不可以直接把array解构出来,传递给一个函数呢?
#include nlohmann/json.hpp #include iostream #include fstream #include tuple #include string #include type_traits using json = nlohmann::json; // ============ 函数特征提取 ============ templatetypename Func struct function_traits; // 普通函数指针 templatetypename Ret, typename... Args struct function_traitsRet(*)(Args...) { using args_tuple = std::tupleArgs...; }; // 普通函数 templatetypename Ret, typename... Args struct function_traitsRet(Args...) { using args_tuple = std::tupleArgs...; }; // 成员函数指针 templatetypename Class, typename Ret, typename... Args struct function_traitsRet(Class