Question Details

No question body available.

Tags

c++ pointers visual-c++ memory-address temporary-objects

Answers (1)

January 27, 2026 Score: 7 Rep: 124,776 Quality: Medium Completeness: 60%

C++23 7.6.2.2 (final working draft):

  1. The operand of the unary & operator shall be an lvalue of some type T. The result is a prvalue.

In auto v = foo(&bar());, the operand to the unary & operator is not an lvalue and this is therefore invalid.