title: boost::filesystem::path and std::string
body: <p>I have a String class which has a member std::string. One of the constructor is </p>
  
  <pre><code>String (std::string s)
  {
      // member: std::string _mString;
      _mString = s;  // error on path assignment
  }
  </code></pre>
  
  <p>I now have functions that take String as parameter, e.g. Load(String path);</p>
  
  <p>but it turns out that boost::filesystem::path::string() is incompatible with that String constructor, yet, normally assigning is ok</p>
  
  <pre><code>boost::filesystem::path somepath("some directory")
  std::string filename = somepath.extension(); // OK!
  </code></pre>
  
  <p>What is happening? How can I make my constructor work? Thanks.</p>
  
  <p>EDIT: Issue solved by making it const ref, but still curious why the error because it seems ok to pass a copy since it can be assigned directly.
  Error in file xstring</p>
  
  <pre><code>void __CLR_OR_THIS_CALL _Tidy(bool _Built = false,
          size_type _Newsize = 0)
          {   // initialize buffer, deallocating any storage
          if (!_Built)
              ;
          else if (_BUF_SIZE &lt;= _Myres)
              {   // copy any leftovers to small buffer and deallocate
              _Elem *_Ptr = _Bx._Ptr;
              if (0 &lt; _Newsize)
                  _Traits_helper::copy_s&lt;_Traits&gt;(_Bx._Buf, _BUF_SIZE, _Ptr, _Newsize);
              _Mybase::_Alval.deallocate(_Ptr, _Myres + 1);
              }
          _Myres = _BUF_SIZE - 1; // **** ERROR ***
          _Eos(_Newsize);
          }
  </code></pre>