I have defined a template container Tree<T>
, with two member-class iterators : const_iterator
and iterator
Now I would like to add non member comparison operators:
template<typename T>
bool operator==(Tree<T>::const_iterator a, Tree<T>::iterator b)
{
return a.ptr() == b.ptr();
}
But I have the compilation error:
declaration of 'operator==' as non-function
Why? Is this due to the template?