Decltype


Topic | v1 | created by jjones |
Description

In the C++ programming language, decltype is a keyword used to query the type of an expression. Introduced in C++11, its primary intended use is in generic programming, where it is often difficult, or even impossible, to express types that depend on template parameters. As generic programming techniques became increasingly popular throughout the 1990s, the need for a type-deduction mechanism was recognized. Many compiler vendors implemented their own versions of the operator, typically called typeof, and some portable implementations with limited functionality, based on existing language features were developed. In 2002, Bjarne Stroustrup proposed that a standardized version of the operator be added to the C++ language, and suggested the name "decltype", to reflect that the operator would yield the "declared type" of an expression. decltype's semantics were designed to cater to both generic library writers and novice programmers.


Relations

subtopic of C++

C++ (C plus plus) is a general-purpose programming language created by Bjarne Stroustrup as an extens...


Edit details Edit relations Attach new author Attach new topic Attach new resource
Resources

treated in Technique: Immediately-Invoked Function Expression for Metaprogramming

Common C++ guidelines are to initialize variables on use and to make variables const whenever possibl...