title: std::string initialized with istreambuf_iterator
body: <pre><code>char* test(char* path) {
      ifstream f(string(path));
      string str(istreambuf_iterator&lt;char&gt;(f), istreambuf_iterator&lt;char&gt;());
      return str.c_str();
  }
  </code></pre>
  
  <p>This code cannot be compiled at visual studio 2012.</p>
  
  <p>Error is</p>
  
  <pre><code>error C2228: left of '.c_str' must have class/struct/union
  </code></pre>
  
  <p>What is the problem? Any suggestion?</p>