Class Template Argument Deduction in C++17
Offered By: ACCU Conference via YouTube
Course Description
Overview
Explore Class Template Argument Deduction (CTAD) in C++17 through this comprehensive ACCU 2018 conference talk by Timur Doumler. Delve into the practical applications of CTAD and automatic deduction guides for writing cleaner, more concise code. Learn how to effectively use CTAD with the C++ standard library and when designing custom classes. Understand the language rules behind CTAD, including when and how to implement user-defined deduction guides. Discover potential pitfalls such as unexpected template argument deductions, constructor selection issues, and unsafe code scenarios, along with strategies to avoid them. Cover topics including template argument deduction in C++98, vector implementations, sequence containers, maps, locks, mutexes, smart pointers, type identity idioms, templated constructors, std::function, SFINAE, aggregates, and CTAD's interaction with nested types and smart pointer conversions.
Syllabus
Intro
template argument deduction in C++98
vector
pitfall!
magic!
trap #1: the order matters
trap #2: list-initialisation has priority
sequence containers
map
locks & mutexes
example with no arguments
other STL classes...
smart pointers
how to disable CTAD
type identity idiom
member typedef
templated ctor
std: function
deduction guides SFINAE
aggregates need explicit guides
CTAD uses the primary template
CTAD not just in declarations!
no CTAD in nested types
CTAD + smart pointer conversions
Taught by
ACCU Conference
Related Courses
Khronos Sycl Language Framework for C++ Accelerators - Take Advantage of All the MIPSACCU Conference via YouTube Space Invaders - The C++20 Spaceship Operator is Upon Us
ACCU Conference via YouTube Grinding, Farming, and Alliances - Become a Better Programmer by Using Words and Ideas From Casual Gaming
ACCU Conference via YouTube Designing for C++ Concurrency Using Message Passing
ACCU Conference via YouTube Productivity in C++ Game Development - Inside the Mind of an AAA Game Developer
ACCU Conference via YouTube