That is a known issue/feature of the VS compilers. They have always allowed that and there does not seem to be any push into removing that extension.
More Related Contents:
- Rvalue Reference is Treated as an Lvalue?
- Return type of ‘?:’ (ternary conditional operator)
- On how to recognize Rvalue or Lvalue reference and if-it-has-a-name rule
- what is return type of assignment operator?
- Is it valid to bind non-const lvalue-references to rvalues in C++ 11?(modified)
- Why is taking the address of a temporary illegal?
- How to determine programmatically if an expression is rvalue or lvalue in C++?
- Why does std::forward have two overloads?
- prolonging the lifetime of temporaries
- Why does an lvalue cast work?
- Why are arrays of references illegal?
- difference between a pointer and reference parameter?
- Why is template argument deduction disabled with std::forward?
- How to compile Qt 5 under Windows or Linux, 32 or 64 bit, static or dynamic on Visual Studio or g++
- Function pointer vs Function reference
- How can I change the variable to which a C++ reference refers?
- How to create a DLL with SWIG from Visual Studio 2010
- Why can’t I do polymorphism with normal variables?
- What is the difference between a const reference and normal parameter?
- Passing rvalues through std::bind
- Difference between const. pointer and reference?
- error C2065: ‘cout’ : undeclared identifier
- Can we get the type of a lambda argument?
- Where ampersand “&” can be put when passing argument by reference?
- STL map containing references does not compile
- C++ static variable in .lib does not initialize
- Using data member in lambda capture list inside a member function
- What does it mean to return a reference?
- Meaning of *& and **& in C++
- Is returning references of member variables bad practice?