Re: SigC::bind - binding reference arguments?



On Tue, 2005-05-24 at 15:46 +0100, Caspar MacRae wrote:
> Hi,
> 
> 
> This is not urgent as I have a work around,
> but I'd still like to know how to do this properly...
> 
> 
> Trying to bind a Gtk::Menu reference as an argument:
> 
>         instanceA.my_signal_changed.connect( SigC::bind<Gtk::Menu&>(
> SigC::slot(instanceA, &ClassA::fill_menu), m_Menu) );
> 
> Produces the following error:
> 
>         /opt/gnome/include/sigc++-1.2/sigc++/bind.h:116: error:
> destructor name `~
>            Gtk::Menu&' does not match type `Gtk::Menu' of expression
>         make: *** [mainwindow.o] Error 1
> 
> However if the Gtk::Menu& argument is changed for Gtk::Menu* (in the
> bind<template> and fill_menu definition) everything compiles and runs fine.

I guess it's saying that it can't copy, and later delete, a reference.
sigc::ref() might solve this. A pointer would be simpler though.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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