This may be caused by the reading loop:
while(!in.eof())
{
std::getline(in, line);
if(line.size() > 0 && line[0] != '#')
{
...
}
else
{
param = line;
value = "";
}
m_data.push_back(make_pair(param, value));
m_size++;
}
!eof() is not a valid stop condition for reading file content. My guess is that you have one unwanted iteration, and end up adding an empty pair every time you read the file. The reason is that eof() will return true only after you try to read past the end of the file. But if you are
at the end, not
after the end, it will still return false. In fact this function is only meant to be used after the stream has switched to invalid state, to query the reason.
You can google it to find more explanations and more correct ways of stopping read loops (quickly: use while (std::getline(...)) and everything should be fine).