Boost logo

Boost Users :

Subject: Re: [Boost-users] signals/slots and boost::functions
From: david.weber_at_[hidden]
Date: 2008-12-10 16:28:37


For those interested, It appears the reason was because of a compiler
error I hit, and didn't ask about, or really worry how to resolve it.
:-/

Function declaration:

typedef boost::function < VSSP ( std::string, EncodingEnum) >
CreateTypeFunc;

bool ElementBase::disconnectCreateTypeSignal(const CreateTypeFunc& slot)
{
    LOG4CXX_DEBUG(logger_, "disconnectCreateTypeSignal in");
    bool retValue = false;

    createTypeSignal_.disconnect(slot);

    <snip!>
}

Error:
(apologies for the length)

c:\Program
Files\boost\boost_1_35_0\boost\signals\signal_template.hpp(242) : error
C2666: 'boost::operator`=='' : 4 over
loads have similar conversions; c:\Program
Files\boost\boost_1_35_0\boost\function\function_base.hpp(669): could be
'boo
st::enable_if_c<B,T>::type boost::operator
==<boost::signal2<R,T1,T2,Combiner,Group,GroupCompare,SlotFunction>::slo
t_fun
ction_type>(Functor,const boost::function_base &) with
[B=true,T=bool,R=boost::detail::function_traits_helper<boost::add
_pointer<boost::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::result_type,T
1=boost::detail::function_traits_helper<boost::add_pointer<boost::shared
_ptr<model::VariantStorage> (std::string,model::
EncodingEnum::EncodingEnum)>::type>::arg1_type,T2=boost::detail::functio
n_traits_helper<boost::add_pointer<boost::shared
_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::arg2_type,Combi
ner=boost::last_valu
e<boost::detail::function_traits_helper<boost::add_pointer<boost::shared
_ptr<model::VariantStorage> (std::string,model::
EncodingEnum::EncodingEnum)>::type>::result_type>,Group=int,GroupCompare
=std::less<int>,SlotFunction=boost::function<mod
el::VariantStorageSharedPtr
(std::string,model::EncodingEnum::EncodingEnum)>,Functor=boost::signal2<
boost::detail::funct
ion_traits_helper<boost::add_pointer<boost::shared_ptr<model::VariantSto
rage> (std::string,model::EncodingEnum::Encoding
Enum)>::type>::result_type,boost::detail::function_traits_helper<boost::
add_pointer<boost::shared_ptr<model::VariantStor
age>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::arg1_type,boost
::detail::function_traits_helper<boost::add
_pointer<boost::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::arg2_type,boo
st::last_value<boost::detail::function_traits_helper<boost::add_pointer<
boost::shared_ptr<model::VariantStorage> (std::s
tring,model::EncodingEnum::EncodingEnum)>::type>::result_type>,int,std::
less<int>,boost::function<model::VariantStorageS
haredPtr
(std::string,model::EncodingEnum::EncodingEnum)>>::slot_function_type]';
c:\Program Files\boost\boost_1_35_0\bo
ost\function\function_base.hpp(660): or
'boost::enable_if_c<B,T>::type boost::operator ==<Function>(const
boost::f
unction_base &,Functor) with
[B=true,T=bool,Function=model::ElementBase::CreateTypeFunc,Functor=model
::ElementBase::Crea
teTypeFunc]'; c:\Program
Files\boost\boost_1_35_0\boost\function\function_template.hpp(832): or
'void boost::opera
tor ==<R,T0,T1,Allocator>(const boost::function2<R,T0,T1,Allocator>
&,const boost::function2<R,T0,T1,Allocator> &) with
[R=model::VariantStorageSharedPtr,T0=std::string,T1=model::EncodingEnum:
:EncodingEnum,Allocator=std::allocator<void>]';
or 'built-in C++
operator==(boost::function2<R,T0,T1,Allocator>::safe_bool with
[R=model::VariantStorageSharedPtr,
T0=std::string,T1=model::EncodingEnum::EncodingEnum,Allocator=std::alloc
ator<void>], boost::function2<R,T0,T1,Allocator>
::safe_bool with
[R=model::VariantStorageSharedPtr,T0=std::string,T1=model::EncodingEnum:
:EncodingEnum,Allocator=std::al
locator<void>])'; while trying to match the argument list
'(boost::signal2<R,T1,T2,Combiner,Group,GroupCompare,SlotFunct
ion>::slot_function_type with
[R=boost::detail::function_traits_helper<boost::add_pointer<boost::share
d_ptr<model::Varia
ntStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::result_type,T1=
boost::detail::function_traits_helper
<boost::add_pointer<boost::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::ar
g1_type,T2=boost::detail::function_traits_helper<boost::add_pointer<boos
t::shared_ptr<model::VariantStorage> (std::strin
g,model::EncodingEnum::EncodingEnum)>::type>::arg2_type,Combiner=boost::
last_value<boost::detail::function_traits_helper
<boost::add_pointer<boost::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::re
sult_type>,Group=int,GroupCompare=std::less<int>,SlotFunction=boost::fun
ction<model::VariantStorageSharedPtr (std::strin
g,model::EncodingEnum::EncodingEnum)>], const
model::ElementBase::CreateTypeFunc)'; c:\Program
Files\boost\boost_1_35_0\
boost\signals\signal_template.hpp(224) : see reference to function
template instantiation 'void boost::signal2<R,T1,T2,C
ombiner,Group,GroupCompare,SlotFunction>::do_disconnect<T>(const
Function &,boost::mpl::bool_<C_>) with [R=boost::detail
::function_traits_helper<boost::add_pointer<boost::shared_ptr<model::Var
iantStorage> (std::string,model::EncodingEnum::E
ncodingEnum)>::type>::result_type,T1=boost::detail::function_traits_help
er<boost::add_pointer<boost::shared_ptr<model::V
ariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::arg1_type,T2=bo
ost::detail::function_traits_help
er<boost::add_pointer<boost::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::
arg2_type,Combiner=boost::last_value<boost::detail::function_traits_help
er<boost::add_pointer<boost::shared_ptr<model::V
ariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::result_type>,Gr
oup=int,GroupCompare=std::less<in
t>,SlotFunction=boost::function<model::VariantStorageSharedPtr
(std::string,model::EncodingEnum::EncodingEnum)>,T=model:
:ElementBase::CreateTypeFunc,Function=model::ElementBase::CreateTypeFunc
,C_=false]' being compiled; c:\Documents and Set
tings\td26134\Desktop\trunk1\src\model\ElementBase.cpp(440) : see
reference to function template instantiation 'void boo
st::signal2<R,T1,T2,Combiner,Group,GroupCompare,SlotFunction>::disconnec
t<model::ElementBase::CreateTypeFunc>(const T &)
 with
[R=boost::detail::function_traits_helper<boost::add_pointer<boost::share
d_ptr<model::VariantStorage> (std::string,
model::EncodingEnum::EncodingEnum)>::type>::result_type,T1=boost::detail
::function_traits_helper<boost::add_pointer<boos
t::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::arg1_type,T2=bo
ost::detail
::function_traits_helper<boost::add_pointer<boost::shared_ptr<model::Var
iantStorage> (std::string,model::EncodingEnum::E
ncodingEnum)>::type>::arg2_type,Combiner=boost::last_value<boost::detail
::function_traits_helper<boost::add_pointer<boos
t::shared_ptr<model::VariantStorage>
(std::string,model::EncodingEnum::EncodingEnum)>::type>::result_type>,Gr
oup=int,Gro
upCompare=std::less<int>,SlotFunction=boost::function<model::VariantStor
ageSharedPtr (std::string,model::EncodingEnum::E
ncodingEnum)>,T=model::ElementBase::CreateTypeFunc]' being compiled
scons: *** [build_dir\Windows\src-model\ElementBase.obj] Error 2


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net