class result_of<Fn(ArgTypes...)> 头文件: <type_traits> 用于在编译的时候推导出一个可调用对象(函数,std::funciton或者重载了operator()操作的对象等)的返回值类型.主要用于模板编写中. 模板参数: Fn 可调用对象 ArgTypes... 参数列表. 注意是类型(int , string等) 成员: type 可调用对象的
lpText,lpCaption,uType);}}然后到处用cdecl_wrapper::MessageBoxA来替换MessageBoxA吧。
2. 类型判断用来判断函数模板的类型 #include<iostream>#include<type_traits>//is_same//#include <typeinfo> //typeid不需要包含此头文件,typeid是C++关键字autofun(){std::stringstr ="string";returnstr; }intmain(){ decltype(fun()) str1;//decltype比较适合用来推断表达式的值的类型或函数返回值的类型...