RE: Reptr



> 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



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