Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi-index][foreach] Iterating over a sequence index (worked in 1.46, broke in 1.47)
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2011-07-31 13:57:11


Michel MORIN <mimomorin <at> gmail.com> writes:

>
> Maxime van Noppen wrote:
> > On 07/29/2011 09:36 AM, Igor R wrote:
> >>
> >> It seems that gcc attempts to copy the index, for some reason.
> >>
> >> BTW, your code compiles well with VC10.
> >
> > So it looks like it's a g++ and clang++ bug ?
>
> It's not a bug.
>
> GCC 4.6 (in C++03 mode) changes the behavior of rvalue conversion.
> This affects the way of lvalue/rvalue detection in Boost.Foreach;
> then compilation error occurs.
>
> To detect detecting lvalue/rvalue, Boost.Foreach tries to copy
> `sequenced_index` (though the copy is never executed…).
> However, the copy ctor of `sequenced_index` is protected,
> and so the compile error emitted.

I understand the problem and will have no problem in fixing
it from Boost.MultiIndex side since there is a documented
way to do that in Boost.Foreach, but before doing that I'd like
to know what's the opinion of Eric on this, since no such
workaround was needed for prior versions of Boost.Foreach.

I'll post a separate queswtion and act accordingly to the
results.

Best,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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