C++ Insights - Episode 41: How type-traits work

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

Andreas Fertig

Andreas Fertig

Күн бұрын

Пікірлер: 9
@davithov
@davithov 8 ай бұрын
First, thank you very much for the great lecture! I have a question: so we use integral_constant type, but isn't it possible somehow provide only value, i.e., for example `true`? Because we know, right, that `true` (or `false`) are of type bool? So IMO, it will be more natural to find a way to provide only values. Maybe should we use function templates to be able to deduce type? But, on the other hand, if I am not mistaken, starting from c++17 classes also deduce type, so maybe somehow can we use this?
@lev-th
@lev-th 6 ай бұрын
Difference is that integral_constant and integral_constant are of different types.
@andreas_fertig
@andreas_fertig 6 ай бұрын
With C++17 we can have "auto" as a non-type template parameter. This allows you to use a single parameter cppinsights.io/s/39165dba
@davithov
@davithov 5 ай бұрын
@@andreas_fertig That's fantastic! Thank you for the answer )
@XYZW12
@XYZW12 Жыл бұрын
What is the value for is_pointer?
@davithov
@davithov 8 ай бұрын
I guess `true`, because it IS a pointer to... doesn't matter to what (in this case ... to pointer)
@andres_sempai
@andres_sempai Жыл бұрын
Great video
@McDonaldIbekwe
@McDonaldIbekwe Жыл бұрын
Thank for the video.
@violencethriller2689
@violencethriller2689 Жыл бұрын
hi @Andres would you mind if you switch to dark mode background for your vid, i really appreciate if you do that, im sory but i dont really use to read in white background just bcuz my eyes can't keep up
C++ Insights - Episode 42: C++20: When is a struct an aggregate
4:52
C++ Insights - Episode 40: The traps of returning references
9:08
Andreas Fertig
Рет қаралды 1,1 М.
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
C++ Insights - Episode 55: References are no pointers!
4:00
Andreas Fertig
Рет қаралды 1,1 М.
C++ Insights - Episode 51: The magic of C++20s std::source_location
5:07
C++ Insights - Episode 43: A copy constructor cannot be a template
3:18
C++ Insights - Episode 54: You can't force a move!
4:07
Andreas Fertig
Рет қаралды 665
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН