decltype

decltype is a type deduction specifier in C++ which deduce the value type to its declaration form. The value could be a name, an expression, or keywords such as auto.

Because of its stringent type deduction strategy, it is often advised to use it carefully especially when used in guessing the function’s return type. If the function is intended to return a reference type, decltype is the way to go. Otherwise, thick to the keyword auto which guarantee to be a value instead of a reference.

#cpp