
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