
On 6 May 2014 15:55, Rob Stewart <robertstewart@comcast.net> wrote:
On May 6, 2014 9:37:33 AM EDT, Jonathan Wakely <jwakely.boost@kayari.org> wrote:
On 6 May 2014 12:45, Andrzej Krzemienski wrote:
Do you know if this a bug in VC++, or if that is supposed to be
valid?
It's valid, the reference should bind directly to global_i.
In the code he provided, the assertion failure means that the address of the reference ii != the address of global_i. That's surprising.
Maybe I misunderstood the exact question. Obviously it's surprising, because it's wrong, like I said "the reference should bind directly to global_i" i.e. it should not bind to a temporary. What I meant (but might have failed to say) is that the program is valid, and the assertion should not fail. I didn't mean VC++'s behaviour is valid.