
Daniel Lidström wrote:
Hello!
I'm trying to use boost::bind and boost::function to perform a callback mechanism. However, the VC2005 compiler crashes for some reason. Let me show the code right away:
[snip]
struct Fl_Widget;
typedef boost::function
CBF_Callback; struct Fl_Widget { CBF_Callback cbf_callback_; boost::any user_data_;
[snip]
struct RailCaterpillarControllerGUI { Fl_Widget widget;
RailCaterpillarControllerGUI() { // cbToggleDeadZone should be called by widget's callback CBF_Callback callback(boost::bind(&RailCaterpillarControllerGUI::cbToggleDeadZone, this)); widget.cbf_callback(callback); }
[snip]
The compiler seems to crash when trying to compile the RailCaterpillarControllerGUI constructor. Any ideas why? I'm using 8.0.50727.867 (vsvista.050727-8600), boost-1.34.1
Try adding the argument placeholders to your bind call: // cbToggleDeadZone should be called by widget's callback CBF_Callback callback( boost::bind( &RailCaterpillarControllerGUI::cbToggleDeadZone, this, _1, _2 )); HTH / Johan