[signals] unresolved overloaded function type with gcc 4.1

Hi,
i'm stucked and google does not lead me to the right pages :-(
The follwing code example does not compile on gcc 4.1.1 an boost 1.33.1 . It
works on msvc.net 7.1.
---code starts here
#include

On Mon, 26 Jun 2006 13:52:24 +0200, Lars Monecke
Hi,
i'm stucked and google does not lead me to the right pages :-(
The follwing code example does not compile on gcc 4.1.1 an boost 1.33.1 . It works on msvc.net 7.1.
---code starts here #include
#include #include <iostream>
struct Printer { void operator()(int iValue) { std::cout << iValue << "\n"; } };
int main(int /* argc */, char* /* argv[] */) {
typedef boost::signal
tSignal; tSignal stSignal;
Printer stPrinter; stSignal.connect(stPrinter); typedef std::vector<int> tConInts;
tConInts cInts;
cInts.push_back(1); cInts.push_back(2); cInts.push_back(3);
for_each(cInts.begin(), cInts.end(), boost::bind(&tSignal::operator(), boost::ref(stSignal), _1));
return 0; } ---code ends here
Any hints? Doesn't something like for_each(...,...,bind(stSignal,_1));
work? (Maybe with bind<Ret>(), see docs) Regards Jiri Palecek -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Jiri Palecek wrote:
Doesn't something like for_each(...,...,bind(stSignal,_1));
work?
::signal1(const boost::signal1
>&)': /usr/local/gcc-4.1.1/boost-1.33.1/boost/signals/signal_template.hpp:142: note: synthesized method 'boost::boost_signals::detail::signal_base::signal_base(const boost::boost_signals::detail::signal_base&)' first required here /usr/local/gcc-4.1.1/boost-1.33.1/boost/signal.hpp: In copy constructor 'boost::signal >::signal(const boost::signal >&)': /usr/local/gcc-4.1.1/boost-1.33.1/boost/signal.hpp:333: note: synthesized method 'boost::signal1 ::signal1(const boost::signal1 >&)' first required here
Sorry, no:
/usr/local/gcc-4.1.1/boost-1.33.1/boost/noncopyable.hpp: In copy constructor
'boost::boost_signals::detail::signal_base::signal_base(const
boost::boost_signals::detail::signal_base&)':
/usr/local/gcc-4.1.1/boost-1.33.1/boost/noncopyable.hpp:27: error:
'boost::noncopyable_::noncopyable::noncopyable(const
boost::noncopyable_::noncopyable&)' is private
/usr/local/gcc-4.1.1/boost-1.33.1/boost/signals/detail/signal_base.hpp:119:
error: within this context
/usr/local/gcc-4.1.1/boost-1.33.1/boost/signals/signal_template.hpp: In copy
constructor 'boost::signal1

Jiri Palecek wrote:
On Mon, 26 Jun 2006 13:52:24 +0200, Lars Monecke
wrote:
[...]
for_each(cInts.begin(), cInts.end(), boost::bind(&tSignal::operator(), boost::ref(stSignal), _1));
return 0; } ---code ends here
Any hints? Doesn't something like for_each(...,...,bind(stSignal,_1));
work?
Signals are noncopyable, but for_each( cInts.begin(), cInts.end(), boost::bind( boost::ref( stSignal ), _1 ) ); should work.

Peter Dimov wrote:
for_each( cInts.begin(), cInts.end(), boost::bind( boost::ref( stSignal ), _1 ) );
should work.
Yes. Thank You, Best Regards Lars -- Lars Monecke http://www.monecke.de PGP-Key unter https://www.monecke.de/infos/monecke.asc
participants (3)
-
Jiri Palecek
-
Lars Monecke
-
Peter Dimov