0

Does anyone know why boost bind takes address of member function but for non-member functions does not require address.

For example:

boost::bind( &CMyClass::doSomething, this );

vs

boost::bind( RegularFunction );

In theory could boost have had implementation be so one could bind as follows:

boost::bind( CMyClass::doSomething, this );

or would this not work ?

sehe
  • 374,641
  • 47
  • 450
  • 633
steviekm3
  • 905
  • 1
  • 8
  • 19
  • 2
    It's not just boost::bind - taking the address of a member function always requires the use of the `&` operator, taking the address of a normal function does not. That's the way the language is specified. –  Sep 09 '17 at 16:36
  • Thanks. I did not realize that C++ required passing member functions that way. – steviekm3 Sep 09 '17 at 16:50

0 Answers0