Re: Reptr



Foster, Gareth wrote:

Glib::RefPtr smart pointers are a way of life in gtkmm... when one of these is declared, you never use "new" to instantitate them, but rather you call a "create" method. The nice thing about them is that the smart pointer manage the memory and references themselves... i.e. you don't have to "delete" them yourself. handy, eh?


Aye, I am okay with the refptr idea, what is weird in that case is ...

	Glib::Refptr<foo> & ref_bar;
	                  ^
     	            |
           	       --------------- erm ...

So that would give me a C++ reference to a Glib::Refptr, I thought you would
maybe want  ...

	Glib::Refptr<Glib::Refptr<foo> > ref_bar;

Or possibly, just ...

	Glib::Refptr<foo> ref_bar = ref_someOtherBar;



Hopefully that is a little more clear.

Cheers mate,

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

Yeah, I see what you're getting at here. It appears that this would give you the address in memory that is holding the value of the memory address of the actual object. I'm like you... why would you want that?


Bob



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