J
Joe Laughlin
(file and class names changed to protect the innocent)
g++ -Wall -c file.cpp: In member function `std::string
Some_Class::get_member(const std::string&) const':
file.cpp:46: passing `const std::map<std::string,
std::string, std::less<std::string>, std::allocator<std:air<const
std::string, std::string> > >' as `this' argument of `_Tp& std::map<_Key,
_Tp, _Compare, _Alloc>:perator[](const _Key&) [with _Key = std::string,
_Tp = std::string, _Compare = std::less<std::string>, _Alloc =
std::allocator<std:air<const std::string, std::string> >]' discards
qualifiers
I can't make heads or tails of this error. I'm guessing it has something to
do with calling a non-const function on some const object. Any ideas?
The function SomeClass::get_member is:
std::string SomeClass::get_member(const std::string &name) const
{
return _member[name];
}
where _member is a std::map<std::string, std::string>.
g++ -Wall -c file.cpp: In member function `std::string
Some_Class::get_member(const std::string&) const':
file.cpp:46: passing `const std::map<std::string,
std::string, std::less<std::string>, std::allocator<std:air<const
std::string, std::string> > >' as `this' argument of `_Tp& std::map<_Key,
_Tp, _Compare, _Alloc>:perator[](const _Key&) [with _Key = std::string,
_Tp = std::string, _Compare = std::less<std::string>, _Alloc =
std::allocator<std:air<const std::string, std::string> >]' discards
qualifiers
I can't make heads or tails of this error. I'm guessing it has something to
do with calling a non-const function on some const object. Any ideas?
The function SomeClass::get_member is:
std::string SomeClass::get_member(const std::string &name) const
{
return _member[name];
}
where _member is a std::map<std::string, std::string>.