cppforever.com

decltype

The decltype keyword inspects the type of an expression at compile time and produces that type without evaluating the expression.

Typical use cases:

Example:
int x = 5;
decltype(x) y = 10; // y is int

decltype((x)) r = x; // r is int& (note: parentheses matter)
decltype(x + 2) z; // z is int

decltype does not run the expression; it only inspects its type.