Gcc 3.2.3“没有用于调用的匹配函数”模板函数的错误

时间:2011-11-21 22:14:33

标签: c++ templates gcc

.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 .. :(

0 个答案:

没有答案