Launch Your Cybersecurity Career in 6 Months
Learn AI, Data Science & Business — Earn Certificates That Get You Hired
Overview
AI, Data Science & Cloud Certificates from Google, IBM & Meta — 40% Off
One plan covers every Professional Certificate on Coursera. 40% off Coursera Plus Annual.
Unlock All Certificates
Explore the advantages and potential pitfalls of trailing return types and `auto` return in modern C++ in this CppCon 2022 conference talk by Pablo Halpern. Learn about the syntax, restrictions, and use cases for these features, including their application in function templates and lambda expressions. Discover how to leverage these language elements to improve code clarity and convenience while avoiding common mistakes that can lead to readability issues and latent bugs. Gain insights into the relationship between trailing return types and automatically deduced return types, and understand when and how to use them effectively in your C++ projects.
Syllabus
Introduction
Trailing Return Types
Decotype
Use Cases
Auto Return
Template parameter type deduction
Conversion operator
Syntax limitations
Decotype Auto
Decorating Auto
Half Interval
Mutex Lock
Pitfalls
Documentation
Mitigation Strategy
recursive factorial
two different templates
you get the fallback
use it with caution
Questions
Taught by
CppCon