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

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 9

  • @davithov
    @davithov 7 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

      Difference is that integral_constant and integral_constant are of different types.

    • @andreas_fertig
      @andreas_fertig  5 หลายเดือนก่อน +1

      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 7 หลายเดือนก่อน

      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