Back to Basics: Templates in C++ - Nicolai Josuttis - CppCon 2022

preview_player
Показать описание
---

Back to Basics: Templates in C++ - Nicolai Josuttis - CppCon 2022

Templates are among the most powerful features of C++, but they remain misunderstood and underutilized, even as the C++ language and development community have advanced. This talk shows when and how to use modern templates to build software that's cleaner, faster, more efficient, and easier to maintain. We will cover all basic aspects of templates you have to know when programming generic code in Modern C++
---

Nicolai Josuttis

Nicolai Josuttis is well-known in the community for his authoritative books and talks. For more than 20 years he has been a member of the C++ Standard Committee. He is the author of several worldwide best-sellers, including:

- C++20: The Complete Guide
- C++17: The Complete Guide
- C++ Move Semantics: The Complete Guide
- The C++ Standard Library: A tutorial and Reference
- C++ Templates: The Complete Guide (w/ David Vandevoorde & Doug Gregor)
__

#cppcon #programming #template
Рекомендации по теме
Комментарии
Автор

Great talk. I believe that understanding templates reveals most of the C++ programming language.

moderncpp
Автор

Wow the master himself. His book on templates is excellent. Thanks for this video.

wigglyk
Автор

Nico is a great speaker, I've been looking forward to this one!

superscatboy
Автор

Hands down the best templates course I've ever had. Thanks!!

deadbird
Автор

Its amazing how Nico can make extremely complex topics approachable. I bought all his books!

parthapratimmukherjee
Автор

Wow, this is trippy. Didn't know this was a thing:

if constexpr (requires {coll.push_back(val);})

OptimusVlad
Автор

This is exactly what I was looking for! Great talk!

prafulsrivastava
Автор

Fantastic talk, thank you, I'm just starting to learn templates and this helped immensely, many thanks.

stevea.b.
Автор

That's a pure pleasure to listen to the prelection like this. Thank you!

MyLucjusz
Автор

Very cool talk. Always good to recapitulate the basics - there are to many things we use without understanding the underlying tech and history.
BTW: Where can I get this awesome T-Shirt?

the_real_foamidable
Автор

thank you. even better the second time around! : )

flocela
Автор

Great talks! I love your books! You're absolutely amazing. BTW, I am looking for "Back to Basics 2022" playlist but couldn't find it.

sky_is_the_limit_
Автор

It feels, to me, i have to know all of c++. Idk why. Whenever he waives his hands on some somewhat deprecated or irrelavant topics or on some dark corners, i t feels unsatisfactory...

kuijaye
Автор

Templates are pretty awesome now, as is this talk ;)

xFabi
Автор

We need an "if compiles{" expression that takes the first branch if the code in that branch compiles 😅

darkbb
Автор

35:46 std::complex is only specified for float, double and long double, not for int.

MalcolmParsons
Автор

nice talk.
i had one query on slide no.31, why recursive call to "if" statement when you know number of var args. why not "range for".

sanjaygatne
Автор

This is why a TypeEval function is screaming to be created. I am 100% certain the std::people can create a better one than I can. Typeid() doesn't actually consider a tuple of string/int/string the same type as a tuple of variant/variant/map as the same types so there is no secure way to funnel them into whatever place or process they need to be. A bool function is totally fine as long as it is general (i.e. one container type instance should match with another, and with its type-name, regardless of their particular flavor of chaos inside). Knowing everything at compile time is neither realistic nor creatively workable. "Strongly typed" needs to not just be a begrudging neurosis or a religious mantra but also lead to supplying the proper tools for the coder to secure this strength on his or her end.

djupstaten
Автор

Interesting talk, though not as 'basic' as I assumed.

It would have been helpful if the speech bubbles were removed; the code in the speech bubbles could have been placed side-by-side with the code on the left. For example, at 4:18, the text in the speech bubble could have been replaced with the code on the left but with "T" and "typename" swapped out for "CustomType" and "class". The explanation need not change.

4:16 "...use a better name, like CustomType as shown in the example on the right".
3:37 "...can be replaced by class, as you can see in the example on the right..."

Edit: I just noticed the speech bubbles do help as annotations in other slides.

gnerkus
Автор

C with better structure, which is c++.

BiddutMitra