I am trying to write a function for parsing a config.ini file but I've come across this error I've not really come across before
'std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::basic_string<char,std::char_traits<char>,std::allocator<char>>> std::make_pair<std::string,std::string>(_Ty1 &&,_Ty2 &&)': cannot convert argument 1 from 'std::string' to 'std::string &&'
My code looks like this:
std::map<std::string, std::string> Iasynth::getConfigOptions(std::string const & configData)
{
std::map<std::string, std::string> result;
std::istringstream iss(configData);
bool key = true;
std::string keyData;
std::string valueData;
for (std::string token; std::getline(iss, token, '\n'); )
{
for (std::string token; std::getline(iss, token, '='); )
{
if (key)
{
keyData = std::move(token);
key = false;
}
else
{
valueData = std::move(token);
result.insert(std::make_pair<std::string, std::string>(keyData, valueData));
key = true;
}
}
}
return result;
}