title: What is the most elegant way to read a text file with c++?
body: <p>I'd like to read whole content of a text file to a <code>std::string</code> object with c++. </p>
  
  <p>With Python, I can write:</p>
  
  <pre><code>text = open("text.txt", "rt").read()
  </code></pre>
  
  <p>It is very simple and elegant. I hate ugly stuff, so I'd like to know - what is the most elegant way to read a text file with C++?
  Thanks.</p>