Eliminar referencia

You can dereference a smartpointer with the -> operator, to call the methods of the underlying instance, just like a normal pointer.

Glib::RefPtr<Gdk::Pixbuf> refPixbuf = Gdk::Pixbuf::create_from_file(filename);
int width = refPixbuf->get_width();

Pero a diferencia de la mayoría de punteros inteligentes, no se puede utilizar el operador * para acceder a la instancia de base.

Glib::RefPtr<Gdk::Pixbuf> refPixbuf = Gdk::Pixbuf::create_from_file(filename);
Gdk::Pixbuf& underlying = *refPixbuf; //Syntax error - will not compile.