title: Converting class to string
body: <p>This is derived from Herb Sutter's gotw3 (http://www.gotw.ca/gotw/003.htm).</p>
  
  <p>With the following class and <code>FindAddr</code> function...</p>
  
  <pre><code>using std::string;
  using std::list;
  
  class Employee
  {
  public:
      Employee(const string&amp; n, const string&amp; a) : name(n), addr(a) { }
      string name;
      string addr;
  };
  
  string FindAddr(const list&lt;Employee&gt;&amp; l, const string&amp; name)
  {
      string addr;
      list&lt;Employee&gt;::const_iterator i = find(l.begin(), l.end(), name);
  
      if (i != l.end()) {
          addr = (*i).addr;
      }
      return addr;
  } 
  </code></pre>
  
  <p>I get a compile error because the Employee class has no conversion to string.  I can see that such a conversion is not necessarily sensible, but for the purpose of the exercise, I added a naive conversion:</p>
  
  <pre><code>string::string(const Employee&amp; e)
  {
      return e.name;
  }
  </code></pre>
  
  <p>This gives me an error: </p>
  
  <pre><code>gotw3.cc:17:9: error: C++ requires a type specifier for all declarations
  string::string(const Employee&amp; e)
  ~~~~~~  ^
  </code></pre>
  
  <p>What am I doing wrong?  </p>