|
From: <qa...@ho...> - 2002-10-21 16:10:31
|
Hello all,
I get an errormessage when I compile and I can't figure out what the=
problem is.
Here's the code
#include <iostream>
#include <list>
int main(int argc, char *argv[]){
list<int> initialWeightList;
for(int i=3D0; i<10; i++)
initialWeightList.push_back(i);
list<int>::iterator iter;
for(
iter =3D initialWeightList.begin();
iter < initialWeightList.end(); // <--- error ?!?!?!
iter++
){
cout << "Here i do something" << endl;
}
}
and here's the errormessage
12 D:\Programmering\IDE\Dev-Cpp\__Projects\Test\main.cpp
no match for `_List_iterator<int,int &,int *> & < _List_iterator<int,int=
&,int *>'
The for-statement is split up so I can locate the error
Any ideas?
If I replace all list<int> by vector<int>, and include <vector> ofcourse,=
it works just fine.
Regards
/J=F6rgen
|