title: Access class member "directly" like std::string
body: <p>I would like the following code to be equivalent:</p>
  
  <pre><code>f = "abc";
  h.data = f;
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong> I'd also like the ability to do the following:</p>
  
  <pre><code>f += "def"; // f.data == "abcdef";
  std::string s = f; // s = "abcdef";
  
  std::cout &lt;&lt; f &lt;&lt; std::endl;
  std::cin &gt;&gt; f;
  
  std::vector&lt;std::string&gt; v (f);
  v.push_back(h);
  
  // This would be overkill.
  printf("%s", (f + std::string("...\n")).c_str());
  </code></pre>
  
  <p>Would I need to "inherit" <code>std::string</code> or something? (I'm new to this stuff, so could you show me how?)</p>
  
  <hr>
  
  <p>Here's my class:</p>
  
  <pre><code>class Foo
  {
  public:
      std::string data;
  } f, h;
  </code></pre>