Boost logo

Boost :

Subject: Re: [boost] [system][filesystem v3] Question abouterror_code arguments
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-10-27 14:20:48


Andrey Semashev wrote:
>
> Perhaps, we could mark the non-throwing overloads as
> deprecated in the
> Standard? Like strstreams, they are there but generally throwing
> overloads are more preferred.

Why is it necessary to impose a single view on the language? Authors often give advice and situations demand certain concessions. Isn't it reasonable to accommodate many use cases? If you're too restrictive, you make C++ less appealing and users will choose other languages. Is that helpful?

In the context of using error_code, I think it is quite reasonable to overload all functions such that those with an error_code parameter don't throw, but rather put their error information in that parameter for the caller to inspect, while the overloads without an error_code parameter throw exceptions. Those that prefer exceptions will not pass an error_code argument. Those that cannot or won't use exceptions can pass an error_code argument.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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