Re: [sigc] sigc::bind<> argument copy error
- From: Jeff Franks <jcf tpg com au>
- To: Martin Schulze <martin-ml hippogriff de>
- Cc: libsigc-list gnome org
- Subject: Re: [sigc] sigc::bind<> argument copy error
- Date: Sun, 09 Nov 2003 21:31:28 +1100
Martin Schulze wrote:
Could you please provide a test case that reproduces the problem?
Martin,
Here is an attasched example that reproduces the problem.
Regards,
Jeff Franks.
#include <sigc++/sigc++.h>
#include <iostream>
// compile with: g++ test_bind.cc -o test_bind `pkg-config sigc++-2.0 --cflags --libs`
struct Data
{
};
class Widget : public sigc::trackable
{
Widget(const Widget&);
Widget& operator=(const Widget&);
public:
Widget()
{
}
};
class Object : public sigc::trackable
{
Object(const Object&);
Object& operator=(const Object&);
typedef sigc::slot<bool, Widget&> Slot;
Slot slot_;
public:
Object(const Slot& slot)
: slot_(slot)
{
}
};
bool foo(Widget& widget, Data *data)
{
std::cout << "inside foo" << std::endl;
return true;
}
int main(int argc, char *argv[])
{
Data *data = new Data;
Object object(sigc::bind<0>(sigc::ptr_fun(&foo), data));
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]