R
r.simoni
Hi, i have seen that this operator returns a reference to TYPE and not
a const reference.
I have a problem and I can't solve it:
i have a properties class with a get_property(const string &) function
that is const due to the fact that this method doesn't change the
"content" of properties class. If I write the method as this:
const string& get_property(const string& key) const {
return all_prop[key];
}
i receive an error in compile. The only way I have found to solve this
is to define class member all_prop as mutable. Is it correct? Is there
another way for coding this?
Thanks to all
Bye
a const reference.
I have a problem and I can't solve it:
i have a properties class with a get_property(const string &) function
that is const due to the fact that this method doesn't change the
"content" of properties class. If I write the method as this:
const string& get_property(const string& key) const {
return all_prop[key];
}
i receive an error in compile. The only way I have found to solve this
is to define class member all_prop as mutable. Is it correct? Is there
another way for coding this?
Thanks to all
Bye