Boost logo

Boost :

Subject: Re: [boost] [AFIO] Review (or lack of it)
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-08-30 14:27:13


On 29-Aug-15 3:12 AM, Michael Marcin wrote:
> On 8/28/2015 1:51 AM, Vladimir Prus wrote:
>> On 28-Aug-15 5:28 AM, Niall Douglas wrote:
>>>> * I doubt that std::cerr should be in this library's code.
>>> Use of std::cerr is only when something truly unusual occurs, like we
>>> are about to fatal exit the process and I would assume the user would
>>> like to know why we just called std::terminate. Or we are about to
>>> deadlock, and again the user probably wants to know why their
>>> application has just hanged itself.
>>
>> It might be helpful for some cases, but then what about Windows UI
>> applications.
>> I, for one, does not know a way to extract std::cerr of an app that does
>> not have
>> a console, so if this were a useful mechanism, it should use debug log
>> there.
>>
>
> You just use rdbuf to set the stream buffer.
> You can see an example here for cout.
>
> http://www.cplusplus.com/reference/ios/ios/rdbuf/

Michael,

thanks for the suggestion. However, that seems a general advice; and I'm aware
that you can change buffer like so, but I'd rather not write custom code
to create a stream buffer that uses OutputDebugString. Other libraries
don't force me to do so.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk