C
cayblood
Hello,
I have a vector of pointers to a class, like so:
vector<Node*> m_parents;
I'm having trouble creating an iterator to go through the elements in
this vector. Here is my syntax:
vector<Node*>::iterator iter = m_parents.begin();
And here is the error I'm getting:
/usr/include/gcc/darwin/4.0/c++/bits/stl_iterator.h: In constructor
`__gnu_cxx::__normal_iterator<_Iterator,
_Container>::__normal_iterator(const
__gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter =
sbn::Node* const*, _Iterator = sbn::Node**, _Container =
std::vector<sbn::Node*, std::allocator<sbn::Node*> >]':
src/node.cpp:86: instantiated from here
/usr/include/gcc/darwin/4.0/c++/bits/stl_iterator.h:609: error: invalid
conversion from 'sbn::Node* const* const' to 'sbn::Node**'
Any ideas?
Thanks for all the help you guys have been giving me.
Carl
I have a vector of pointers to a class, like so:
vector<Node*> m_parents;
I'm having trouble creating an iterator to go through the elements in
this vector. Here is my syntax:
vector<Node*>::iterator iter = m_parents.begin();
And here is the error I'm getting:
/usr/include/gcc/darwin/4.0/c++/bits/stl_iterator.h: In constructor
`__gnu_cxx::__normal_iterator<_Iterator,
_Container>::__normal_iterator(const
__gnu_cxx::__normal_iterator<_Iter, _Container>&) [with _Iter =
sbn::Node* const*, _Iterator = sbn::Node**, _Container =
std::vector<sbn::Node*, std::allocator<sbn::Node*> >]':
src/node.cpp:86: instantiated from here
/usr/include/gcc/darwin/4.0/c++/bits/stl_iterator.h:609: error: invalid
conversion from 'sbn::Node* const* const' to 'sbn::Node**'
Any ideas?
Thanks for all the help you guys have been giving me.
Carl