Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-12-16 09:15:05

On Monday 16 December 2002 01:39 am, Greg Dehaas wrote:
> //Macros for binding functions + methods
> #define BINDMETHOD5(object,function)
> boost::bind(function,object,_1,_2,_3,_4,_5)
> #define BINDFUNCTION5(function) boost::bind(function,_1,_2,_3,_4,_5)
> #define BINDMETHOD4(object,function)
> boost::bind(function,object,_1,_2,_3,_4)
> #define BINDFUNCTION4(function) boost::bind(function,_1,_2,_3,_4)
> #define BINDMETHOD3(object,function) boost::bind(function,object,_1,_2,_3)
> #define BINDFUNCTION3(function) boost::bind(function,_1,_2,_3)
> #define BINDMETHOD2(object,function) boost::bind(function,object,_1,_2)
> #define BINDFUNCTION2(function) boost::bind(function,_1,_2)
> #define BINDMETHOD1(object,function) boost::bind(function,object,_1)
> #define BINDFUNCTION1(function) boost::bind(function,_1)
> #define BINDMETHOD(object,function) BINDMETHOD1(object,function)
> #define BINDFUNCTION(function) BINDFUNCTION1(object,function)

The BINDFUNCTION macros aren't actually needed. Anywhere that you would have:

  boost::functionN<...> f;

You could have just written:
  boost::functionN<...> f;
  f = g;

I'd also strongly suggest that you don't use the BINDMETHOD macros, because
sooner or later you'll find yourself needing to use more of bind's features.


Boost list run by bdawes at, gregod at, cpdaniel at, john at