lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [PATCH] Define operator<<(fs::path) in the right namespace


From: Greg Chicares
Subject: Re: [lmi] [PATCH] Define operator<<(fs::path) in the right namespace
Date: Wed, 11 May 2016 16:53:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0

On 2016-02-10 20:06, Vadim Zeitlin wrote:
> 
>  While testing compilation of SOA code with the new compilers (MSVC14 and
> g++ 4.9), I started getting a lot of errors for all the code constructing
> error messages with paths like this:
> 
>       fs::path path = ...;
>       std::ostringstream oss;
>       oss << "Failed to open '" << path << "'";
> 
>  Looking at this closer, I actually don't understand how could it compile
> before with Boost 1.33 (later versions, which I used until very recently,
> define operator<<() inside the path class itself) because operator<<() is
> defined in the global namespace in path_utility.hpp and so has no reason to
> be found if the code like above is inside some other namespace, as the
> compiler is only supposed to check that namespace as well as std namespace
> and boost::filesystem one because of argument-depending lookup rule.
> 
>  So, AFAICS, the current code is just incorrect and only happens to work
> because there is no code using operator<<(fs::path) inside a namespace yet.
> If you agree, please apply the attached patch, which was tested it with g++
> 4.9 (and MSVC14).

Committed 20160511T1650Z, revision 6575.

I see no better place to put this inserter. It certainly doesn't belong
in 'config.hpp'. It doesn't seem worthwhile to fret very much over this
because boost later realized it belongs in the path class.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]