no instance of overloaded function getline c++
<p>I'm a bit confused as to what i have incorrect with my script that is causing this error.</p>

<p>I have a function which calls a fill for game settings but it doesn't like my getline.</p>

<p>Also i should mention these are the files i have included for it:</p>

<pre><code>#include &lt;fstream&gt;
#include &lt;cctype&gt;
#include &lt;map&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;algorithm&gt;
#include &lt;vector&gt;
using namespace std;'
</code></pre>

<p>This is what i have:</p>

<pre><code>std::map&lt;string, string&gt; loadSettings(std::string file){

ifstream file(file);
string line;

std::map&lt;string, string&gt; config;

while(std::getline(file, line))
{
    int pos = line.find('=');
    if(pos != string::npos)
    {
        string key = line.substr(0, pos);
        string value = line.substr(pos + 1);
        config[trim(key)] = trim(value);
    }
}
return (config);
}
</code></pre>

<hr>

<p>The function is called like this from my <code>main.cpp</code></p>

<pre><code> //load settings for game
 std::map&lt;string, string&gt; config = loadSettings("settings.txt");
 //load theme for game
 std::map&lt;string, string&gt; theme = loadSettings("theme.txt");
</code></pre>

<p>Where did i go wrong ? Please help!</p>

<p>The error:</p>

<p><code>settings.h(61): error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline(std::basic_istream&lt;_Elem,_Traits&gt; &amp;&amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;&amp;' from 'std::string'
</code></p>
