抽象类中的模板函数

时间:2016-08-11 10:21:59

标签: c++ templates polymorphism abstract-class

我想扩展一个现有的抽象基类,该函数将被模板化并具有作为输入参数的模板迭代器。

让我们考虑以下示例:

class base
{
 public:
 [...]

 template < int nT, typename T> 
 void do_something( A<nT, T>::iterator arg)
{
}

};

我见过这个example,但不太喜欢。

编辑:

class base
    {
     public:
     [...]

     template < int nT, typename T> 
     void do_something( typename A<nT, T>::iterator arg)
    {
    }

    };

代码编译,但是当我调用函数时,我得到了错误

:-1: error: symbol(s) not found for architecture x86_64

0 个答案:

没有答案