0

I would like to extend an existing abstract base class with a function which is going to be templated and have as input argument an iterator to a template.

Lets consider the following example:

class base
{
 public:
 [...]

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

};

I have seen this example, but is not quite like.

edit:

class base
    {
     public:
     [...]

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

    };

The code compiles, but when I call the function I get the error

:-1: error: symbol(s) not found for architecture x86_64
NEN
  • 1
  • 1
  • 2
  • When I call this function as shared_ptr derived_object->do_somthing< 1, float >( array_iter); I get : :-1: error: symbol(s) not found for architecture x86_64 – NEN Aug 11 '16 at 10:39
  • @AmiTavory Thank you, I have typename, I just omitted for simplicity – NEN Aug 11 '16 at 10:42
  • Let me guess: you placed the code of `do_something` in a cpp file? It's template code - put it in the header. – Ami Tavory Aug 11 '16 at 10:44

0 Answers0