Boost logo

Boost :

Subject: Re: [boost] BOOST_FOREACH not compiling with Multindex containers, Intel Compiler version 11
From: lipik (contact.lipik_at_[hidden])
Date: 2008-11-17 13:25:06


Eric Niebler <eric <at> boost-consulting.com> writes:

>
> lipik wrote:
> > Hi,
> >
> > I use boost.Multindex in my code, to simulate std::map. The code works fine
> > on VC++ 2003 and Intel Compiler 10, but after upgrading to ICL 11 (latest),
> > I can't use BOOST_FOREACH macros like so:
[...]
> In the mean time, you can try turning off rvalue detection by defining
> BOOST_FOREACH_NO_RVALUE_DETECTION. But then you can't use BOOST_FOREACH
> on rvalue sequence expressions.
>

I suspect it is not a simple case, since this compiles fine:
typedef std::map<std::wstring, std::wstring> wsm;
wsm sm_;
BOOST_FOREACH(const wsm::value_type &sv, sm_) {
        wcslen(sv.first.c_str());
}

The problem occurs where I have used Multindex to define maps (the value type
is a pair-like class that has the 'second' member is marked mutable, because
Multindex containers only expose the contained data as const).

Oh, and it compiles with BOOST_FOREACH_NO_RVALUE_DETECTION defined.

Thanks


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