Glib::RefPtr + const cast



Hi,
I'm trying this,
I've a variable of this type
Glib::RefPtr<const Gtk::ListStore> list_store_c,
how can i remove the constness of the variable,
I'm trying a crude way of doing this....

Gtk::ListStore* list_store = const_cast<Gtk::ListStore*>(list_store_c.operator->()) ;

I dont know if there are any problems in doing this, and are there any elegent ways of doing this.
I've looked at Glib::RefPtr documentation, it has only 2 functions on casting, cast_dynamic and cast_static,

Thanks,
Surya




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