The RefPtr smartpointer

Glib::RefPtr is a smartpointer. Specifically, it is a reference-counting smartpointer. You might be familiar with std::auto_ptr<>, which is also a smartpointer, but Glib::RefPtr<> is much simpler, and more useful. We expect a future version of the C++ Standard Library to contain a reference-counting shared smartpointer, and a future version of gtkmm might possibly use that instead.

参考

A smartpointer acts much like a normal pointer. Here are a few examples.