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



> On Thu, 24 Nov 2005 07:10:14 -0800, Carl Worth wrote:
>> If binding to a language that supports exceptions it probably does
>> make sense to call _get_status after each call and throw exceptions.
>
> Sounds slow ...

The function is probalby just returning an integer. And we would just if()
the result. Is that likely to be significant?

The function could even be inlined in cairo, if it isn't already, and I
plan to inline the C++ part of it, just because it's so simple.

> why can't Cairo have some on_error callback that is called
> whenever the internal status code is changed to !success?

That would make it difficult to throw exceptions through the C callback.

> That way, in a C
> program it'd do nothing (except maybe you could set it to log the failing
> call) and in a C++ binding it'd be hooked to throw an exception.


Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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