Let's get comfortable with SFINAE (C++)

  Рет қаралды 3,672

platis.solutions

platis.solutions

Күн бұрын

In this video we get comfortable with an advanced C++ topic: SFINAE
SFINAE stands for Substitution Failure Is Not An Error. It is a C++ template metaprogramming technique that allows us to choose between implementations depending on the "characteristics" of a type.
In other words it's not about what a type is, but what it can do.
It's a very powerful technique that allows us to write generic code that can be used with different types, and it's used extensively in the standard library.
I am planning to write a blog post about it so that you can have the code in a more usable format.
I will do this once I reach 1000 subscribers, so if you liked the video and would like to get hold of the code, please subscribe and share the video with your friends. 🎉
2024 Update: 1000 Subscribers reached!
Here's the tutorial in a written form: platis.solutions/blog/2024/01...
00:00 Introduction, disclaimers and prerequisites
02:31 SFINAE: What and why?
05:54 SFINAE alternatives
09:43 Basic SFINAE without std::enable_if
16:26 std::enable_if
19:31 SFINAE with std::enable_if
23:09 Creating traits
26:30 std::void_t
28:55 Introspection with declval
30:36 SFINAE on class member functions
32:15 Disabling or enabling functions with SFINAE
34:06 SFINAE and fold expressions
34:42 Conclusion and takeaways

Пікірлер: 19
@platisd
@platisd 4 ай бұрын
1000 subscribers reached! Here's the written tutorial: platis.solutions/blog/2024/01/27/lets-get-comfortable-with-sfinae/
@heartbrave7476
@heartbrave7476 5 күн бұрын
超级棒的视频,深入浅出,娓娓道来,使我明白了很多关于C++的用法。
@hr1100
@hr1100 3 күн бұрын
Thank you for this. I've read several articles and watched cpp con presentations. Your take on the subject was the best i've encountered yet all because you eased us in with the very basic building blocks first.
@_noisecode
@_noisecode 26 күн бұрын
Great, approachable, yet in-depth tutorial on an advanced topic. KZbin needs more content just like this.
@platisd
@platisd 26 күн бұрын
Thank you so much for the kind feedback! :}
@pawankataria5970
@pawankataria5970 Ай бұрын
Thanks for this, you made SFINAE easy for the world !
@vukasinstrbac3742
@vukasinstrbac3742 7 ай бұрын
A good explanation. A perfect continuation would be achieving the same thing with concepts.
@zeez7777
@zeez7777 Ай бұрын
This is truly an amazing video. Thank you for this presentation.
@user-fz5pw5kg3w
@user-fz5pw5kg3w 6 ай бұрын
Thank you! Your examples were excellent, and I came away with a better understanding of SFINAE and alternatives.
@lullabydayal1202
@lullabydayal1202 7 ай бұрын
I've listened to Dimitris talk in C++ Athens meetup. This is a brilliant session covering SFINAE; its alternatives and some cool techniques with it (I wouldn't know). I'm planning to revisit this video again for referring some advanced topics discussed whenever I need. I would recommend this video as a great watch to all C++ enthusiasts.
@Chupe_chupe
@Chupe_chupe 27 күн бұрын
Great video
@UsernameUsername0000
@UsernameUsername0000 4 ай бұрын
Perfect presentation & pace!
@eotcoldhymns2930
@eotcoldhymns2930 7 ай бұрын
really great video from scratch
@MrCiscoski
@MrCiscoski 8 ай бұрын
Thanks this was really well presented
@gatita_liliana
@gatita_liliana 8 ай бұрын
ahhhhhhhhhhhhhh great video
@pengliu9987
@pengliu9987 2 ай бұрын
Nice and informative video. One suggestion to the terminology of "subclass" at 14:45 (At kzbin.info/www/bejne/Y4uadoKNi9CVaa8). Things such as typename S::IpV4, S::IpV6 in C++ are called member type, while "subclass" typically means "derived class".
@platisd
@platisd 2 ай бұрын
You're correct! I hadn't noticed this until you mentioned it. Another term could be "nested class". 👍
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Рет қаралды 5 МЛН
Dynamic #gadgets for math genius! #maths
00:29
FLIP FLOP Hacks
Рет қаралды 18 МЛН
OMG 😨 Era o tênis dela 🤬
00:19
Polar em português
Рет қаралды 10 МЛН
CppCon 2017: Arthur O'Dwyer “A Soupçon of SFINAE”
1:01:17
The Pointer to Implementation (pImpl) idiom in C++
6:54
platis.solutions
Рет қаралды 10 М.
How to write SOLID C++
29:22
platis.solutions
Рет қаралды 36 М.
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 756 М.
CURACAO 2024 Eels
1:28
AJP's Diving Video's
Рет қаралды 3 М.
Can C++ be 10x Simpler & Safer?  - Herb Sutter - CppCon 2022
1:54:00
Why Favor Object Composition Over Class Inheritance? A Deep Dive
19:00
Куда пропал 3D Touch? #apple #iphone
0:51
Не шарю!
Рет қаралды 531 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 221 М.
МОЖНО ЛИ заряжать AirPods в чехле 🧐😱🧐 #airpods #applewatch #dyson
0:22
Apple_calls РЕПЛИКА №1 В РФ
Рет қаралды 18 М.