[cairo] [cairomm] RefPtr<T>::operator*() ?

Ian Britten britten at caris.com
Wed Aug 20 07:29:43 PDT 2008

Jonathon Jongsma wrote:

>> Just a suggestion, but it might be nice if the cairomm RefPtr
>> class had an operator*() (Or, a get(), or something).
>> Otherwise, if func() is written to accept a "const T &", you
>> have to write code like:
>>         Cairo::RefPtr<T> someObj;  (Populated from somewhere)
>>         func( *someObj.operator->() );
>> instead of the simpler/cleaner
>>         func( *someObj );

> If there is API in cairomm that accepts a 'const T&' where T is supposed 
> to be used via RefPtr, it is likely an API bug.  Unfortunately I 
> discovered one of these just in the last couple days (the ScaledFont 
> constructor) and plan to fix it in a future release.  If you find 
> further places where this is the case, please file a bug.

Oops!  Sorry if I wasn't clear...
In my example, func() was one of my own functions that I had
written (It was actually a template function, but that's irrelevant
to this).
I didn't mean to imply it was a cairomm function.


More information about the cairo mailing list