vector does not name a type

I don't why, but it doesn't recognize neither vector nor string....I think I must have some wrong configuration in my settings project, but I don't what it can be...does any one can help me?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

#include <stdio.h>
#include <string>
#include <tuple>
#include <iostream>
#include <vector>


struct Assoc{
	vector<pair<string,int>> vec;
	
	const int& operator[] (const string&) const;
	int& operator[](const string&);
};



int main(){
	
}

Last edited on
Add on line 8:
1
2
3
using std::vector;
using std::string;
using std::pair;
that's true they belong to the standard library...I guess I could insert too
1
2

using namespace std;
There is a rationale, why the language supports namespaces. I do suggest that you read first: http://www.gotw.ca/publications/migrating_to_namespaces.htm

Thanks, as my file was a simple .cpp I could use using directive but with more files, headers files and source files declare namespace explicitly in headers and use using directive in source files....thanks
Topic archived. No new replies allowed.