Boost logo

Boost :

From: Fabrice Truillot (fte_at_[hidden])
Date: 2000-07-06 14:56:18


on 6.7.2000 21:27, Mark Rodgers at mark.rodgers_at_[hidden] wrote:

> Thank you! (I would prefer to say that you have found what is wrong with
> CodeWarrior though ;-)

Marf ! 8-))
 
> Does this compile with your fix in place?
>
> #include <boost/functional.hpp>
>
> class Person
> {
> public: bool isFred () const { return false; }
> };
>
> int main()
> {
> const Person fred;
> boost::mem_fun_ref(&Person::isFred)(fred);
> }
>
> It should, but I fear it might not.

"As is", CodeWarrior give me : "const variable needs initializer" (on const
Person fred;).

And then...

#include <boost/functional.hpp>

class Person
{
  public: Person () {}
  public: bool isFred () const { return false; }
};

int main()
{
  const Person fred;
  boost::mem_fun_ref(&Person::isFred)(fred);
}

WORKS ! 8-)

CodeWarrior warns me about a few implicit const casts and return value (int
main () and no return ;-). But it works !

Fab'
________________________________________________________________________


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk