Summary
This episode explains decltype(auto), a powerful C++11 feature that deduces the exact type of an expression, including reference and const qualifiers. Jason demonstrates how decltype(auto) differs from regular auto, particularly in the context of function return types where it can perfectly preserve the type returned by a wrapped function. The feature is especially valuable in generic code when precise type deduction is needed.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[expr.type.conv]51% match -
[diff.cpp20.utilities]50% match -
[diff.cpp23]48% match -
[diff.cpp23.dcl.dcl]48% match