Re: [cairo] Re: cairo c++ bindings



On 11/24/05, Carl Worth <cworth 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.

What do you think ?

Rui Pires


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]