0

I am trying to write a container as

 template <typename T, typename A = std::allocator<T> >    
 class circular_dlist{
     ....
     public:

     class iterator{ 
       ....
     };

     void insert(T& val);
 };

In .cpp file when I define insert() method as:

template <typename T, typename A = std::allocator<T> > 
void circular_dlist<T, A>::insert(T& val){
}

I get following error:

error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11

What is the correct syntax for defining function outside class definition in such cases if I am not using c++11?

sap
  • 75
  • 1
  • 1
  • 10

1 Answers1

0

Write simply

template <typename T, typename A> 
void circular_dlist<T, A>::insert(T& val){
}
Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335