void example(const map<string, vector<int> > & num);
int main()
{
map<string, vector<int> >num;
num["A"].push_back(1);
example(num);
return 0;
}
void example(const map<string, vector<int> > & num)
{
cout << num["A"].size() << endl;
}
i think the size() did not change the value of num, but why it cause error when complie it? it's ok when i removed the keyword const in the example function.