Michel MORIN
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