GNOME Bugzilla – Bug 165222
visit_each looked up with ADL, causing ambiguity
Last modified: 2005-01-28 21:54:21 UTC
When using 2 versions of sigc in different namespaces (for personal reasons) ADL causes an ambiguity when mem_fun calls visit_each. Item 1 shows the compiler error. Item 2 is a patch solving the problem Item 1: test.C:208: instantiated from here /opt/app/gnome-2.4/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:267: error: call of overloaded `visit_each(const sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>&, sigc::pointer_functor3<MyMetaClient*, MetaContract*, meta_updated_flag, void>&)' is ambiguous /opt/app/gnome-2.4/include/sigc++-2.0/sigc++/visit_each.h:113: error: candidates are: void sigc::visit_each(const T_action&, const T_functor&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_functor = sigc::pointer_functor3<MyMetaClient*, MetaContract*, meta_updated_flag, void>] /home/lex/SANDBOX2/install/include/toast/0.2/toast/signals/visit_each.H:113: error: void toast::signals::visit_each(const T_action&, const T_functor&) [with T_action = sigc::internal::limit_derived_target<sigc::trackable*, sigc::internal::slot_do_bind>, T_functor = sigc::pointer_functor3<MyMetaClient*, MetaContract*, meta_updated_flag, void>] gmake: *** [test.o] Error 1 gmake: *** Waiting for unfinished jobs.... Item 2: *** adaptor_trait.h.orig 2005-01-25 13:50:12.928361000 -0600 --- adaptor_trait.h 2005-01-25 13:50:54.599570000 -0600 *************** *** 264,270 **** void visit_each(const T_action& _A_action, const adaptor_functor<T_functor>& _A_target) { ! visit_each(_A_action, _A_target.functor_); } --- 264,270 ---- void visit_each(const T_action& _A_action, const adaptor_functor<T_functor>& _A_target) { ! sigc::visit_each(_A_action, _A_target.functor_); }
OK. Committed. Thanks. Please try to create an actual cvs patch (this was a generated file) and patch the ChangeLog, in future: http://www.gtkmm.org/bugs.shtml#CreatingPatches
Same issue found in mem_fun.h. Attaching the patch.
Created attachment 36670 [details] [review] Patch for 165222 issue found in mem_fun.h also
OK. Applied. Thanks.