Re: Create a new object and return to a RefPtr



Since it's Glib::RefPtr::RefPtr<T>(T*), with T being a typename, you would need to accordingly use RefPtr<T> pT (new T(...));

With an assignment, you can only assign another RefPtr<T> with T being the same type as the T of the lvalue.

2008/6/3 Dinh Khac Thanh <thanhdk gmail com>:
Hi,

I created a custom class that inherits from Gdk::Pixmap with custom constructor. How do I instantiate an object from this class and then make a RefPtr point to that object? For example Item* pItem= new Item(some params here); But for RefPtr:   RefPtr<Item> pItem = ?

Thank you for your support.

Regards



_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]