我正在使用libclang绑定(为了方便:https://pypi.org/project/libclang/)。 我有以下代码(最少的示例):
struct TemplateFunctionSpecHolder
{
template<typename T>
int templateMethodSpec_1(double b) { return 7;}
};
template<>
int TemplateFunctionSpecHolder::templateMethodSpec_1<char>(double b)
{
return 8;
}
我已将光标指向第二种方法(模板规范)。不幸的是,cursor.get_num_template_arguments()、cursor.type.get_num_template_arguments()和其他(例如cursor.canonical.get_num_template_arguments())给了我-1。任何获取模板参数的方法都不起作用。 有没有办法获得专门的模板类型?使用cursor.tokens是非常糟糕的
目前没有回答
相关问题 更多 >
编程相关推荐