Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2006-02-21 09:15:34


Holger Grund wrote:
> "Beman Dawes" <bdawes_at_[hidden]> wrote
>
>> Do other Boosters like the idea of an overall guideline for dealing with
>> operating system API error reporting?
>>
> Absolutely.
>
>> Do the specific guidelines make sense? How can they be improved?
>>
> I don't quite understand the part with void returns and overloaded
> and non-overloaded functions. Obviously, overloaded function
> declarations can't differ by return type only. Do you suggest
> to supply a non-throwing function with a different name/scope
> or a function template?
> If so, how should its interface look like?

// function returning a value:
int foo(); // throws on API error
int foo( system_error_code_type& ec ); // does not throw

// function not normally returning a value:
void bar(); // throws on API error
system_error_code_type foo(system_error_code_type& ec); // doesn't throw

--Beman


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