[cairo] Re: cairo c++ bindings
Murray Cumming
murrayc at murrayc.com
Thu Nov 24 08:17:14 PST 2005
> On 11/24/05, Carl Worth <cworth at cworth.org> wrote:
>>
>> No. C coders are not meant to call _get_status repeatedly. What
>> happens is that if _get_status would return an error status then
>> basically all of that object's functions become NOOPs. That is, it is
>> still safe to call functions on that object and defer the _get_status
>> error checking until a convenient time.
>>
>> If binding to a language that supports exceptions it probably does
>> make sense to call _get_status after each call and throw exceptions.
>>
>> -Carl
>>
>>
> I don't know if anyone else agrees with me, but I think the idea of having
> the wrapper be configurable with a policy to handle the errors is highly
> attractive.
> The alternative would be to have a bool checkForErrors and check if before
> checking and handling errors. This would imply run-time overhead, while
> using the policies would not.
An if(somebool) will not add a significatn amount of run-time overhead.
I'd be happy to add a Cairo::set_ignore_errors(bool) function.
This use of exceptions does seem slightly unusual. If an error can be
ignored, then it does not seem to be an exceptional error.
Murray Cumming
murrayc at murrayc.com
www.murrayc.com
www.openismus.com
More information about the cairo
mailing list