我只是最近尝试用升压:: function_types库,我已经遇到一个有点障碍的。 我想找出给定函数的调用约定,但我不太清楚如何做到这一点。 这是我到目前为止有:
这会产生如何,如果语句不能发现里面每个* _cc标签值的误差。 我怀疑它可能有一些做与我定义宏的方式; 文件是不是有关如何使用您的编译器设置额外的调用约定...在这里任何帮助,将不胜感激非常清晰。
谢谢,
编辑:得到它的工作,好像我需要包括配置/ config.hpp,如下图所示:
#define BOOST_FT_COMMON_X86_CCs 1
#include <boost/function_types/config/config.hpp>
#include <boost/type_traits.hpp>
#include <boost/function_types/property_tags.hpp>
#include <boost/function_types/is_function.hpp>
#include <boost/function_types/is_function_pointer.hpp>
#include <boost/function_types/parameter_types.hpp>
#include <boost/function_types/result_type.hpp>
#include <boost/function_types/function_arity.hpp>
template<class F>
inline void parse_cc(F f, func_info_s& out) {
out.cc = cc_err;
if (boost::function_types::is_function<F, stdcall_cc>::value == true) {
out.cc = cc_stdcall;
} else if (boost::function_types::is_function<F, fastcall_cc>::value == true) {
out.cc = cc_fastcall;
} else if (boost::function_types::is_function<F, cdecl_cc>::value == true) {
out.cc = cc_cdecl;
}
}