I have a class something like this
Code:
template class<T>
class A{
private:
T m;
T n;
List<T> *start;
List<T> *end;
public:
...
friend ostream & operator<<(ostream &os, A<T> & dy);
}
Code:
template class<T>
ostream & operator<<(ostream &os, A<T> & dy)
{
os<<dy.start->x<<dy.start->y<<dy.start->value;
return os;
}
x,y and value are some public elements of List<T>
I do some operations on list and when I want to print the list elements , I wrote something like in implementation of operator<<, but i get segmentation error. How can i reach those x,y,and value in operator<< implementation?