title: Strange exception from boost::lexical_cast with boost::filesystem
body: <p>On RHEL7.4, boost 1.53,</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;boost/filesystem.hpp&gt;
  #include &lt;boost/lexical_cast.hpp&gt;
  
  using namespace std;
  using namespace boost;
  
  int main() {
      const string&amp; s1 = "1024";
      cout &lt;&lt; "test1:" &lt;&lt; lexical_cast&lt;unsigned int&gt;(s1) &lt;&lt; endl;
  
      filesystem::path p("1024");
      cout &lt;&lt; "test2:" &lt;&lt; lexical_cast&lt;unsigned int&gt;(p.filename().string()) &lt;&lt; endl;
  
      const string&amp; s2 = p.filename().string();
      cout &lt;&lt; "test3:" &lt;&lt; lexical_cast&lt;unsigned int&gt;(s2) &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>This code gives:</p>
  
  <pre><code>test1:1024
  test2:1024
  terminate called after throwing an instance of 'boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::bad_lexical_cast&gt; &gt;'
    what():  bad lexical cast: source type value could not be interpreted as target
  zsh: abort      ./a.out
  </code></pre>
  
  <p>Maybe this is a lexical_cast's bug but someones knows why test3 fails? Especially, I can't understand different between test1 and 3.</p>