Reputation: 353
I created a list and want to check it's size, like this
1. list<State> list;
2. list.push_back (state1);
3. list.push_back (state2);
4. list.push_back (state2);
5. int l = list.size();
Then I got those error:
"[Error] candidates are: std::list<State> list" in line 1.
"[Error] reference to 'list' is ambiguous " in line 5.
How can I fix it?
Upvotes: 1
Views: 7393
Reputation: 428
You are trying to name a variable of class list
with the same name list
. Give it some other name and it should be fine.
Upvotes: 3