Glib::RefPtr instead of std::shared_ptr

I have some application class not implements gobject, but I think to unify project code base by using Glib::RefPtr everywhere (instead of std::shared_ptr).

As understand it’s same as std::shared_ptr but with additional Gtk integrations and everything should work. What is yours opinion?

Glib::RefPtr is defined as an alias for std::shared_ptr in glibmm 2.68.0 and above
(ABI name glibmm-2.68).

template <class T_CppObject>
using RefPtr = std::shared_ptr<T_CppObject>;

It should be possible to use it for any pointer that can be stored in a std::shared_ptr.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.