Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::bind with boost::function
From: maruthilakshman-boost_at_[hidden]
Date: 2009-11-24 00:03:49


Thanks a lot for pointing out my mistake. About the color, I did not specify any background or foreground color. It was Yahoo! mail's default. Am trying to send this message in plain text. Will try to keep this in mind for the messages in future. Thanks once again, Lakshman. ________________________________ From: OvermindDL1 <overminddl1_at_[hidden]> To: boost-users_at_[hidden] Sent: Tue, 24 November, 2009 9:18:32 AM Subject: Re: [Boost-users] Using boost::bind with boost::function On Mon, Nov 23, 2009 at 5:12 PM, <maruthilakshman-boost_at_[hidden]> wrote: > I'm using Boost ver 1.39.0 > > I have a module to which other modules can register callbacks. This module > will call those callbacks with a couple of arguments - as an example > > registerCallBack(void (*callbackFunc)(int)); > > At the time of callback it will call: (*callbackFunc)(3); > > To allow for any function to be registered (each module's callback may have > a different signature etc, but everyone can allow for this one last arg), I > declared it to take a > boost::function<void (int)> > > I was hoping that if I have a twoarg_callback(int, int) function, I can > register it with the module by using boost::bind to bind the first argument, > but that is not possible. I am unable to assign the return value of > boost::bind to a boost::function<void (int)> object by binding one argument. > However, assigning the return value of boost::bind where all the arguments > of a function are bound (so the resulting object is a void() function) seems > to work. > > I'm trying to decipher the errors, but would appreciate any help I can get. > I get errors both on VisualStudio 2008, as well as g++ 4.1.2, so I'm > guessing it's not some compiler problem rather it's my usage. Attached a > sample source file. I commented out the 4 lines that were giving me errors. And please please please do not put your emails as black text on a transparent background. Those of us with black backgrounds see *nothing*. If you specify a text color, then *make*certain* to specify a background color too, but better still, send your emails as plain text. _______________________________________________ Boost-users mailing list Boost-users_at_[hidden] http://lists.boost.org/mailman/listinfo.cgi/boost-users The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/


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