|
Boost Users : |
From: Wu Yinghui, Freddie (yhwu_at_[hidden])
Date: 2006-01-11 20:57:00
Peter Dimov wrote:
> The problem is that
>
> boost::bind(&OperatorMap::value_type::second, _1)
>
> returns an Operator by value (in 1.33.1) or by const reference (in the
> current CVS). Since boost::bind needs to decide on a result type at bind
> time, and since it doesn't know whether the argument coming in from the _1
> is const, it needs to conservatively assume const (Lambda doesn't have this
> limitation because it deduces the return type at call time).
>
> Use
>
> boost::bind<Operator&>(&OperatorMap::value_type::second, _1)
>
> to tell boost::bind to return a non-const reference.
Thanks for your quick reply!
I noticed this problem at about the same time, and tried it out already.
This modification indeed worked.
Cheers,
Freddie
-- Wu Yinghui, Freddie Research & Development Software Engineer Volume Interactions Pte Ltd 1 Kim Seng Promenade, #12-01 Great World City East Tower Singapore 237994 Tel: +65 62226962 (Ext 216) Fax: +65 62226215 Email: yhwu_at_[hidden] URL: http://www.volumeinteractions.com Important: This message is intended for the recipient(s) addressed above. It contains privileged and confidential information. If you are not the intended recipient, please notify the sender immediately by replying to this message and then delete it from your system. You must not read, copy, use, or disseminate this communication in any form. Thank you.
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