|
Boost Users : |
From: James Burgess (jamesrburgess_at_[hidden])
Date: 2006-03-16 20:42:06
This works on gcc3.3 and gcc4.0 (OSX) but doesn't compile on vc8.0
I'm wondering whether it should and I've just messed up somewhere
installing boost 1.33 or vc8 (VS 2005). I noted that the regression
test does not perform this form of disconnect, is that the manual
telling me this isn't supported? I get a very similar error if I try
a functor (using bind) rather than example below ~ "can't convert to
'const int'". There's some comments in signal_template.hpp that
indicate vc 6.0 and 7.0 have problems with this, maybe that #ifdef
needs to include vc8?
cheers,
- James.
#include <iostream>
#include <boost/signals.hpp>
void rfun()
{
std::cerr << "Hello World\n";
}
int _tmain(int argc, char* argv[])
{
boost::signal<void()> sig;
sig.connect(&rfun);
sig.disconnect(&rfun);
return 0;
}
1>------ Build started: Project: testsignals, Configuration: Debug
Win32 ------
1>Compiling...
1>testsignals.cpp
1>i:\testsignals\testsignals.cpp(19) : error C2664:
'boost::signal0<R,Combiner,Group,GroupCompare,SlotFunction>::disconnect'
: cannot convert parameter 1 from 'void (__cdecl *)(void)' to
'const int &'
1> with
1> [
1> R=void,
1> Combiner=boost::last_value<void>,
1> Group=int,
1> GroupCompare=std::less<int>,
1> SlotFunction=boost::function<void (void)>
1> ]
1> Reason: cannot convert from 'void (__cdecl *)(void)' to
'const int'
1> There is no context in which this conversion is possible
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