Snižování referencí
Počitadlo referencí chytrého ukazatele můžete snížit (dereference) pomocí operátoru ->, který zavolá metodu podkladové instance, jako u normálního ukazatele.
auto refPixbuf = Gdk::Pixbuf::create_from_file(filename); auto width = refPixbuf->get_width();
You can also use the * operator and the get() method to access the underlying instance, but it's usually a bad idea to do so. Unless you are careful, you can end up with a pointer or a reference which is not included in the reference count.
auto refPixbuf = Gdk::Pixbuf::create_from_file(filename); auto& underlying = *refPixbuf; // Possible, but not recommended