2 ms·
There are a lot of words on that page and none really jump out at me as explaining why C++ chose to have decltype yield something different for decltype(value)
by loeg 4y ago
There are a lot of words on that page and none really jump out at me as explaining why C++ chose to have decltype yield something different for decltype(value) and decltype((value)). But I was unable to read them all, so maybe it is buried somewhere in there.
- pjmlp 4y agoSorry, could not find a video. See decltype section.
- loeg 4y agoIt provides a series of rules for exactly when decltype() picks a reference or non-reference type, but as far as I can see, it does not explain why the language chose to sometimes return references in some scenarios, such as for '(value)' vs 'value'.