error C2679: binary '=' : no operator found in a const class method

When I change a class method to 'const', got the following errors. Any guru can help look into it ? Thanks in advance.

error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::_Tree<_Traits>::const_iterator' (or there is no acceptable conversion)
with
[
_Traits=std::_Tmap_traits<std::string,std::string,std::less<std::string>,std::allocator<std::pair<const std::string,std::string>>,false>
]

--------------------
1
2
3
4
5
6
7
8
9
10
h file
class ReadConfigFile
{
public:
	
ReadConfigFile(const char *pszFileName);
int	GetParameter(const char *, char *) const;
}
cpp file
int ReadConfigFile::GetParameter(const char *pszParameterKey, char *pszRetParameter) const
{
std::map<std::string, std::string>::iterator itr;
for( itr = m_parameters.begin(); itr != m_parameters.end(); itr++)
-------------------
the client
ReadConfigFile cfgFile(g_confFile);
char tmp[250];
if(cfgFile.GetParameter("start_date",tmp))		strcpy(startDate,tmp);

sorry solved.
I just change the iterator to const_iterator
Topic archived. No new replies allowed.