This seems to me that it should not work, but in VC++ 2008 express it is compiling and running happily. Shouldn't the compiler be complaining about assinging a reference to an rvalue? I'm a bit out of practice these days, so maybe forgetting something here.