Boost logo

Boost Users :

From: Filip Konvička (filip.konvicka_at_[hidden])
Date: 2007-03-13 11:09:36


Joaquín Mª López Muñoz wrote on 13.3.2007 14:55:
> Hello Filip, the problem you describe is only incidentally related with
> Boost.MultiIndex (anyway, thank you for using the lib!):
I thank you! It's just wonderful. I'm coming back to C++ after several
years and I'm excited about the new stuff.
> actually, it's a
> manifestation of a symbol clash between Boost.Lambda and Boost.Bind:
>
...
> You're having the error under the conditions you describe just because
> boost/multi_index/sequenced_index.hpp and
> boost/multi_index/ordered_index.hpp internally include boost/bind.hpp.
>
>> This can of course be fixed by using boost::lambda::_1, but I doubt that
>> it is the expected behavior.
> I guess the using declaration is a perfectly good solution if you don't
> use Boost.Bind in the offending translation unit: This is a well known
> problem with Boost.Bind defining its placeholders in an unnamed
> space (::_1,::_2,...), which causes ambiguity problems when combined
> with the "using namespace boost::lambda" directive. You might want to
> read the following thread for further info on the issue:
>
> http://lists.boost.org/Archives/boost/2004/11/76822.php
>
> AFAIK this is not currently being addressed in any way.
>
Hm, it's a pity that a global "using boost::lambda::_1;" doesn't work.
So I'll probably stick with "lambda::_1" in simple cases, and with local
"using lambda::_1;" in more complex ones.

Thanks for the valuable info!

Cheers,
Filip


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