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

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 9

  • @davithov
    @davithov 6 месяцев назад

    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 4 месяца назад

      Difference is that integral_constant and integral_constant are of different types.

    • @andreas_fertig
      @andreas_fertig  4 месяца назад +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 4 месяца назад

      @@andreas_fertig That's fantastic! Thank you for the answer )

  • @XYZW12
    @XYZW12 Год назад

    What is the value for is_pointer?

    • @davithov
      @davithov 6 месяцев назад

      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