Re: [Boost-bugs] [Boost C++ Libraries] #5152: Inconsistent behavior of path.native() function

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5152: Inconsistent behavior of path.native() function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-04 16:59:53

#5152: Inconsistent behavior of path.native() function
  Reporter: lcarreon@… | Owner: bemandawes
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.45.0 | Severity: Problem
Resolution: wontfix | Keywords:
Changes (by anonymous):

  * status: new => closed
  * resolution: => wontfix


 This was a real head scratcher!

 1. Your test program outputs quotes around the generic_string example but
 not around the native example. That confuses the other issues.

 2. native() returns const string_type&. On posix, string_type is
 std::string, so no problem. Windows, string_type is std::wstring, so
 outputting it to std::cout should result in a compile time error. But...

 3. Your test program is sloppy about namespaces:

    using namespace std;
    using namespace boost::filesystem;

    On Windows, that lets the class path conversion from wstring to kick in
 via ADL, resulting in a path temporary which is then output to cout via
 operator <<.

 4. Operator << with a path correctly places quotes around the output
 string, resulting in the output you are seeing on Windows.

 While it might be nice to poison path::operator<<(), that isn't really a
 bug in class path so I'm closing this as "won't fix".


Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC