|
Boost : |
Subject: Re: [boost] D-style scope guards?
From: Martin Christiansson (martin.christiansson_at_[hidden])
Date: 2010-09-19 06:32:50
>> I've been thinking about a better solution. I need to call a lot of
>> C-functions that use return value and errno for error reporting. Writing a
>> lot of code around each call is a bit clumsy so I tried to create a guard
>> macro instead that puts all relevant data into an exception if the "C
>> function" returned an error.
>>
>
> If you're to make it a library, it's better to generalize for other APIs.
> E.g. use GetLastError() instead of errno for Windows API.
>
Good input! I'm only developing in linux and mac os and lack knowledge
about windows API:s. I'll experiment a bit more and evaluate how
useful it is.
>
> Excuse me if I'm wrong again, but why use boost::bind? Why
> (FUNC)(__VA_ARGS__) won't work?
>
It does work. I no longer need to use bind. The code has evolved a bit
from my first attempts and this was remains from the first version.
/Martin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk