[sigc] help! (problems converting functor to slot?)



I'll try to state the problem as succinctly as I can.  I've been
wrestling with this for weeks, and I'm totally lost.

Given:

        class SPObject;
        
        class LayerManager : /* ... */ public sigc::trackable {
            // ...
            void _rebuild();
            // ...
        };
        
and the following snippet:

        sigc::slot<void, SPObject *> blah = sigc::hide<0>(sigc::mem_fun(*this, &LayerManager::_rebuild));

I get the following cascade of error messages:

        /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In function ‘void sigc::visit_each(const T_action&, const sigc::bound_mem_functor0<T_return, T_obj>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_return = void, T_obj = Inkscape::LayerManager]’:
        /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_functor = sigc::bound_mem_functor0<void, Inkscape::LayerManager>]’
        /usr/include/sigc++-2.0/sigc++/adaptors/hide.h:1032:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::hide_functor<I_location, T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, int I_location = 0, T_functor = sigc::bound_mem_functor0<void, Inkscape::LayerManager>]’
        /usr/include/sigc++-2.0/sigc++/visit_each.h:135:   instantiated from ‘void sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_bind, T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:39:   instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:526:   instantiated from ‘sigc::slot1<T_return, T_arg1>::slot1(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >, T_return = void, T_arg1 = SPObject*]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:1157:   instantiated from ‘sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >, T_return = void, T_arg1 = SPObject*]’
        /home/mental/trees/inkscape/src/layer-manager.cpp:26:   instantiated from here
        /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1799: error: no matching function for call to ‘visit_each(const sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>&, Inkscape::LayerManager&)’
        /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h: In function ‘void sigc::visit_each(const T_action&, const sigc::bound_mem_functor0<T_return, T_obj>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_return = void, T_obj = Inkscape::LayerManager]’:
        /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::adaptor_functor<T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, T_functor = sigc::bound_mem_functor0<void, Inkscape::LayerManager>]’
        /usr/include/sigc++-2.0/sigc++/adaptors/hide.h:1032:   instantiated from ‘void sigc::visit_each(const T_action&, const sigc::hide_functor<I_location, T_functor>&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>, int I_location = 0, T_functor = sigc::bound_mem_functor0<void, Inkscape::LayerManager>]’
        /usr/include/sigc++-2.0/sigc++/visit_each.h:135:   instantiated from ‘void sigc::visit_each_type(const T_action&, const T_functor&) [with T_type = sigc::trackable*, T_action = sigc::internal::slot_do_unbind, T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:60:   instantiated from ‘static void* sigc::internal::typed_slot_rep<T_functor>::destroy(void*) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:38:   instantiated from ‘sigc::internal::typed_slot_rep<T_functor>::typed_slot_rep(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:526:   instantiated from ‘sigc::slot1<T_return, T_arg1>::slot1(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >, T_return = void, T_arg1 = SPObject*]’
        /usr/include/sigc++-2.0/sigc++/functors/slot.h:1157:   instantiated from ‘sigc::slot<T_return, T_arg1, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot(const T_functor&) [with T_functor = sigc::hide_functor<0, sigc::bound_mem_functor0<void, Inkscape::LayerManager> >, T_return = void, T_arg1 = SPObject*]’
        /home/mental/trees/inkscape/src/layer-manager.cpp:26:   instantiated from here
        /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1799: error: no matching function for call to ‘visit_each(const sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_unbind>&, Inkscape::LayerManager&)’
        
Breaking it up further, everything out to sigc::hide<>() appears to work
fine -- it's only when I try to convert the resulting functor to a slot
that I get the error.  Unfortunately, that's the most important part.

Could please someone explain why the conversion fails, and what the
proper way to do this is?

-mental




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