I want to pass a list "node" to a function, read only access of the
list is fine, this is the relevant code I have so far
typedef std::vector<dou ble> myvec;
typedef std::list<myvec > mylist; // a list of vectors
typedef mylist::const_i terator myiter;
void a(myiter &x)
{
int i;
....
// do something with
x[i]
};
The compiler does not like x[i]
"no match for operator [] .."
why is that?
How can I access the node like as if it were a myvec (by reference is
nice if that is OK).
Thanks.
list is fine, this is the relevant code I have so far
typedef std::vector<dou ble> myvec;
typedef std::list<myvec > mylist; // a list of vectors
typedef mylist::const_i terator myiter;
void a(myiter &x)
{
int i;
....
// do something with
x[i]
};
The compiler does not like x[i]
"no match for operator [] .."
why is that?
How can I access the node like as if it were a myvec (by reference is
nice if that is OK).
Thanks.
Comment