[cairo] cairomm RefPtr

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Sat Dec 1 10:06:48 PST 2007


Larry Lewis wrote:
> Is there a specific reason why cairomm's RefPtr implementation (along
> with glibmm) does not provide the T_CppObject& operator*() and
> T_CppObject* get() methods?  Both reference-counting pointer
> implementations I use on a regular basis (boost::shared_ptr and
> Poco::SharedPtr) provide this functionality, which is extremely
> useful for passing the object by reference or directly accessing
> the raw pointer.  It's unfortunate to have to resort to the ugly
> operator->() syntax to access the pointer.

Woops sorry, I misread that, apparently you want the C++ object, not
the C one. But why would you need the pointer to the C++ object? It
only contains is a pointer.

RefPtr is really designed to be used with wrapper objects like these,
not for arbitrary C++ objects.

(Btw, that's all my opinion, I'm not speaking for the cairomm developers.)

Bertram


More information about the cairo mailing list