Question Details

No question body available.

Tags

c++

Answers (1)

June 21, 2026 Score: 2 Rep: 105,264 Quality: Low Completeness: 40%

As you might know, decltype(...) has custom behavior when given a variable name (as opposed to any other expression).

As a part of that, decltype(x) doesn't refer to the capture. It refers to int &x in main().