Here's a nice detailed treatment of auto
and decltype
by longtime author Thomas Becker.
C++ auto and decltype Explained
by Thomas Becker
From the article:
A while later, sometime in 2012, I noticed that there was another feature, or rather, a pair of features, in C++11 that I had not fully understood, namely, the
auto
anddecltype
keywords. Withauto
anddecltype
, unlike rvalue references, the problem is not that they are difficult to grasp. On the contrary, the problem is that the idea is deceptively easy, yet there are hidden subtleties that can trip you up.Let's start with a good look at the
auto
keyword...
Add a Comment
Comments are closed.