Reading a file line by line with boost filesystem C++
<p>I'm using the boost::filesystem library to open a file with a specific path file_path:</p>

<pre><code> fs::ifstream file(file_path);
    string str;
    vector&lt;string&gt; filenames;
    while(getline(file, str)){
        filenames.push_back(str);
    }
</code></pre>

<p>This code has been adapted from regular C++ code without boost. I initially was reading in a file placed in my current directory but I had to edit the path. Now it appears that getline is not working correctly. Is there a boost alternative to getline so that I can parse the file line by line and read them into the vector?</p>

<p>Thanks!</p>