How to use CLASS TEMPLATES, type traits, partial and full class template specialization

  Рет қаралды 983

Code for yourself

Code for yourself

Күн бұрын

Class templates with the ability to partially and fully specialize them are arguably what makes C++ so powerful! We cover most of what one needs to know about what class templates are, how to specialize them fully or partially as well as how it all plays its role if we want to implement type traits.
Before you watch this video I recommend you to watch these videos if you haven't already:
why use templates: • Why use templates in m...
what templates do under the hood: • Templates under the hood
how to use function templates: • How to use FUNCTION TE...
In this video we look at
Class method templates
Class templates
How they can be specialized partially and fully
And as always some easy to follow examples as well as stories about what can go wrong with template specialization
We cover a lot of ground in this video, and it is quite long as much as I tried to keep it very short. Please do not hesitate to comment and tell me what you think or what I might have missed.
📚 As always, the script to the video with all the code examples lives here: github.com/cpp...
Links
CppInsights example mentioned at 06:14 - cppinsights.io...
Class Template Argument Deduction (CTAD) link: en.cppreferenc...
Google C++ Code Style on CTAD: google.github....
Howard Hinnant on vector of booleans: isocpp.org/blo...
Herb Sutter on vector of booleans: www.gotw.ca/pub...
Type traits: en.cppreferenc...
is_integral: en.cppreferenc...
Partial template specialization: en.cppreferenc...
Join this channel to get access to perks
/ @codeforyourself

Пікірлер: 16
How to use FUNCTION TEMPLATES - a comprehensive guide for modern C++
23:33
Code for yourself
Рет қаралды 2,3 М.
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 1,1 МЛН
Шок. Никокадо Авокадо похудел на 110 кг
00:44
C++ Should Be C++ - David Sankel - C++Now 2024
1:28:49
CppNow
Рет қаралды 18 М.
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 175 М.
Use static in classes (when needed) in modern C++
16:34
Code for yourself
Рет қаралды 1,4 М.
How To Create Generics in C#, Including New Features
38:51
IAmTimCorey
Рет қаралды 47 М.
Why I Use C | Prime Reacts
13:00
ThePrimeTime
Рет қаралды 157 М.
Why use templates in modern C++
12:32
Code for yourself
Рет қаралды 1,9 М.
Re-inventing move semantics in modern C++ in 13 minutes
13:20
Code for yourself
Рет қаралды 6 М.
Programming a multiplayer game from scratch in 7 DAYS
18:28
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 1,1 МЛН