C++ Language/Type/Shortcuts/FromAnotherVariable
If variable iOtherVar
has already been defined to have type int
, then definition decltype(iOtherVar) iVar = 22;
is the same as defining int iVar = 22;
.
This decltype()
shortcut can even refer to a full expression.
Additional information about decltype (includes interactive examples)