V
virenpratapsingh
All,
I would appreciate if someone can help me with this. Never used STL
containers extensively, but facing this issue now.
I have a Class A, which has a bunch of member variables and functios.
I have a Class B, which has its own memmber variables, one of them
being a
list <Class A> a;
so if I need to access the List through the member functions of Class
B, like say while using an Iterator...do I need to overlad the
iterator? Since the list isnt standard data-types, is there a need to
overload the iterator ? I didnt think so, but I am getting some errors
while compiling, when I
list<A>::iterator iter(a);
for( iter = iter.begin(), !iter, iter++
{
}
The error(s) being C2264 and c2039(BEGIN NOT MEMBER OF ITERATOR)
Because in the same problem I have used the iterator on a list of
integers and obviously no problem there.
Thanks.
I would appreciate if someone can help me with this. Never used STL
containers extensively, but facing this issue now.
I have a Class A, which has a bunch of member variables and functios.
I have a Class B, which has its own memmber variables, one of them
being a
list <Class A> a;
so if I need to access the List through the member functions of Class
B, like say while using an Iterator...do I need to overlad the
iterator? Since the list isnt standard data-types, is there a need to
overload the iterator ? I didnt think so, but I am getting some errors
while compiling, when I
list<A>::iterator iter(a);
for( iter = iter.begin(), !iter, iter++
{
}
The error(s) being C2264 and c2039(BEGIN NOT MEMBER OF ITERATOR)
Because in the same problem I have used the iterator on a list of
integers and obviously no problem there.
Thanks.