.h文件中的声明,作为Item类的一部分:
template<typename TCastTarget> inline TCastTarget* as() const
{
...
return const_cast<TCastTarget *>(static_cast<const TCastTarget *>(atomicValue));
}
.cpp中的代码:
Numeric* l_ptmp = next.as<Numeric>(); //next is of type Item
错误讯息:
functions / qcomparingaggregator.cpp:129:没有匹配函数来调用'QPatternist :: Item :: as()'
知道这段代码有什么问题吗? Item类不是模板化的,只有as()
函数。
如果这很重要,代码就是Qt模块的一部分。
注意正在使用的旧gcc版本(3.2.3),因为较新版本编译此代码确定。不用说我不能使用更新的Gcc .. :(