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: Michel MORIN (mimomorin_at_[hidden])
Date: 2011-07-29 04:03:48

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.

To compile the code please add the following code:
    namespace boost { namespace foreach
        template<typename SuperMeta,typename TagList>
        struct is_noncopyable<
            boost::multi_index::detail::sequenced_index<SuperMeta, TagList>
> : mpl::true_


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at