Hi,
See this code ...
#include<iostream>
#include
#include
struct CSignal
{
typedef boost::signal< void (void) > UpdateSignal;
UpdateSignal sig;
};
struct CSlot
{:
void update(int i)
{
std::cout << "Call void update( " << i << " )" << std::endl;
}
void connect(CSignal& cs)
{
cs.sig.connect(boost::bind(&CSlot::update, this, 5));
}
void disconnect(CSignal& cs)
{
cs.sig.disconnect(boost::bind(&CSlot::update, this, 5));
}
};
int main()
{
CSignal csignal;
CSlot cslot;
cslot.connect(csignal); csignal.sig();
cslot.disconnect(csignal); csignal.sig();
return (0);
}
When i compile with GCC 4.1.1, this compile fine.
But when i compile with MSVC 2005 it report an error:
.\main.cpp(30) : error C2664:
'boost::signal1::disconnect'
: cannot convert parameter 1 from 'boost::_bi::bind_t' to 'const int
&'
with
[
R=void,
T1=int,
Combiner=boost::last_value<void>,
Group=int,
GroupCompare=std::less<int>,
SlotFunction=boost::function
]
and
[
R=void,
F=boost::_mfi::mf1,
L=boost::_bi::list2,boost::arg<1>>
]
Reason: cannot convert from 'boost::_bi::bind_t' to 'const
int'
with
[
R=void,
F=boost::_mfi::mf1,
L=boost::_bi::list2,boost::arg<1>>
]
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
have you any idee to solve this problem?
thank
david callu