YoVDO

Class Template Argument Deduction in C++17

Offered By: ACCU Conference via YouTube

Tags

ACCU Conference Courses Code Optimization Courses Smart Pointers Courses SFINAE Courses

Course Description

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
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

Основы разработки на С++: коричневый пояс
Moscow Institute of Physics and Technology via Coursera
Intermediate Rust Programming and Advanced Concepts
Packt via Coursera
Intermediate Rust Programming and Web Server Development
Packt via Coursera
Advance Your Skills in C++
LinkedIn Learning
C++: Advanced Topics
LinkedIn Learning