Boost logo

Boost Users :

From: Jaakko Jarvi (jarvi_at_[hidden])
Date: 2006-02-17 15:59:57


On Feb 17, 2006, at 4:14 AM, Christian Rössel wrote:
>
> Thanks for the hint. If I add a "const std::string getA () const
> {return a_;}" to the SearchForMe class then I have to change
>
> bind (&SearchForMe::getA, _1) == "apple");
>
> to
>
> bind (static_cast<string (SearchForMe::*)()>
> (&SearchForMe::getA), _1) == "apple");
>
> or to
>
> bind (static_cast<string (SearchForMe::*const)()>
> (&SearchForMe::getA), _1) == "apple");
>
> and everthings works fine. However, if I do the same with the
> tuple-code
>
> bind (static_cast<int (boost::tuple<int, double>::*)()>
> (&boost::tuple<int, double>::get<0>), _1) == 15);
>
> I still get compile errors:

Get returns a reference. So try:

   bind (static_cast<int& (boost::tuple<int, double>::*)()> ...

instead.

Best, Jaakko


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