Here's a nice detailed treatment of
decltype by longtime author Thomas Becker.
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
decltype, 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