Map and '... discard qualifiers'... very strange problem.

I have a map<int<map<int,char> > variable.
It is declared at the private section of my .h file :

map<unsigned int,std::map<unsigned int,char> > map__type;
I also have :
vector<string> vecHheader;

I use it in this function with sufix const keyword
myfunction (bla bla) const

Ok I can return vector information but not map ???
( I have the const error : ... bla bla bla dicard qualifiers.)

Whats happen ? I can not use map into a const functions ? I want only to returning information !

Any idea ? Thanks .

Hm, I guess it's about the [] operator of map (map__type[3] or so). No, you can't use it when 'map__type' is const since the [] operator creates the field if it doesn't exists. You need to use 'find()' in that situation.
And if I make my map mutable?
What can I expect about the perfomance of mymap or const function?
Thanks
If you do so at least two things can happen:

1. The map gets filled with unwanted data
2. You can't find a 'free' index

You have to answer the questen: What will happen when someone asks for data and the data is not present?
Topic archived. No new replies allowed.