M
Michael
Hi All,
I've wasted heaps of time today trying to get some code I copied from a text
to compile. I have cut it down to the following couple of lines which
demonstrate the core of the problem:
#include <iostream>
#include <list>
//using namespace std;
using std::cout;
using std::cin;
using std::list;
using std::list<int>::iterator;
int main(){
list<int> myList;
iterator<int> it;
return 0;
}
if I try to compile it as above I get :
:7: error: `std::list<int, std::allocator<int> >' is not a namespace
Why?
if I remove the comment marks from the 'using namespace std' and comment out
all the specific 'using's (to try and get round the above) I get:
:12: error: wrong number of template arguments (1, should be 5)
Where did the 5 instead of 1 come from? <sigh>
Thanks for your help
Michael
I've wasted heaps of time today trying to get some code I copied from a text
to compile. I have cut it down to the following couple of lines which
demonstrate the core of the problem:
#include <iostream>
#include <list>
//using namespace std;
using std::cout;
using std::cin;
using std::list;
using std::list<int>::iterator;
int main(){
list<int> myList;
iterator<int> it;
return 0;
}
if I try to compile it as above I get :
:7: error: `std::list<int, std::allocator<int> >' is not a namespace
Why?
if I remove the comment marks from the 'using namespace std' and comment out
all the specific 'using's (to try and get round the above) I get:
:12: error: wrong number of template arguments (1, should be 5)
Where did the 5 instead of 1 come from? <sigh>
Thanks for your help
Michael