没找到具体原因,MSDN看到下面这句,VC是从2008才有这一限制的,感觉就是从语法上对临时变量增加了限定,因为一般说来修改一个临时变量是毫无意义的,通过增加限定,强调临时变量只读语义。虽然实际上修改临时变量并不会有问题。
Visual Studio 2008
In previous releases of Visual C++, non-const references could be bound to temporary objects. Now, temporary objects can only be bound to const references.