i did another test here, like this:

std::cout << boost::filesystem::native("C://PATH") << std::endl;
std::cout << boost::filesystem::native("C:/PATH") << std::endl;
std::cout << boost::filesystem::native("C:\\PATH") << std::endl;
std::cout << boost::filesystem::native("C:\PATH") << std::endl;
std::cout << boost::filesystem::native("\PATH") << std::endl;
std::cout << boost::filesystem::native("\\PATH") << std::endl;
std::cout << boost::filesystem::native("/PATH") << std::endl;
std::cout << boost::filesystem::native("//PATH") << std::endl;

std::cout << boost::filesystem::native("c\PATH") << std::endl;
std::cout << boost::filesystem::native("c\\PATH") << std::endl;
std::cout << boost::filesystem::native("c/PATH") << std::endl;
std::cout << boost::filesystem::native("c//PATH") << std::endl;


No, in VS2015 - 32bits. Build Success.


2016-11-10 20:19 GMT-02:00 Gavin Lambert <gavinl@compacsort.com>:
On 11/11/2016 10:40, Christopher J. Pisz wrote:
On 11/10/2016 2:19 PM, Fernando Gomes da Silva wrote:
std::cout << boost::filesystem::native("C://PATH") << std::endl;
std::cout << boost::filesystem::native("C:/PATH") << std::endl;
std::cout << boost::filesystem::native("C:\\PATH") << std::endl;
std::cout << boost::filesystem::native("C:\PATH") << std::endl;
std::cout << boost::filesystem::native("\PATH") << std::endl;
std::cout << boost::filesystem::native("\\PATH") << std::endl;
std::cout << boost::filesystem::native("/PATH") << std::endl;
std::cout << boost::filesystem::native("//PATH") << std::endl;

0
0
0
0
1
0
0
0

Not at all the expected results.

That's especially weird considering that "\P" should be an invalid escape sequence, which should give you a compiler warning/error and/or should make "\PATH" give identical results to "\\PATH".

Unless you further escaped these before compiling it?



_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users