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

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

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

  • @platisd
    @platisd  7 месяцев назад

    1000 subscribers reached!
    Here's the written tutorial: platis.solutions/blog/2024/01/27/lets-get-comfortable-with-sfinae/

  • @_noisecode
    @_noisecode 4 месяца назад +3

    Great, approachable, yet in-depth tutorial on an advanced topic. RUclips needs more content just like this.

    • @platisd
      @platisd  4 месяца назад

      Thank you so much for the kind feedback! :}

  • @rachelwang3143
    @rachelwang3143 5 дней назад

    Great video, thanks a lot!

  • @pawankataria5970
    @pawankataria5970 5 месяцев назад +1

    Thanks for this, you made SFINAE easy for the world !

  • @heartbrave7476
    @heartbrave7476 3 месяца назад +1

    超级棒的视频,深入浅出,娓娓道来,使我明白了很多关于C++的用法。

  • @vukasinstrbac3742
    @vukasinstrbac3742 11 месяцев назад +3

    A good explanation. A perfect continuation would be achieving the same thing with concepts.

  • @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.

  • @zeez7777
    @zeez7777 5 месяцев назад

    This is truly an amazing video. Thank you for this presentation.

  • @user-fz5pw5kg3w
    @user-fz5pw5kg3w 10 месяцев назад

    Thank you! Your examples were excellent, and I came away with a better understanding of SFINAE and alternatives.

  • @lullabydayal1202
    @lullabydayal1202 11 месяцев назад

    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.

  • @UsernameUsername0000
    @UsernameUsername0000 8 месяцев назад

    Perfect presentation & pace!

  • @eotcoldhymns2930
    @eotcoldhymns2930 11 месяцев назад

    really great video from scratch

  • @Chupe_chupe
    @Chupe_chupe 4 месяца назад

    Great video

  • @MrCiscoski
    @MrCiscoski 11 месяцев назад

    Thanks this was really well presented

  • @chankayau
    @chankayau 2 месяца назад

    SFINAE was like extreme engineering: trying to build a wooden skyscrapper. now `concepts` is the steel invented to safe it.

    • @platisd
      @platisd  2 месяца назад

      Nice metaphor.
      I have some good material on concepts so I wonder if I should make a C++20 follow up on SFINAE 😁

    • @AtomicAndi
      @AtomicAndi 2 месяца назад

      A better metaphor would be: sfinae is dead, thank god

  • @minggai8582
    @minggai8582 2 месяца назад

    in constructor template is necessary because: if you don't give the default type, there is no way for you to construct the this type's object. For example, ContidionalCtor x; The compiler will compile the ConditionalCtor struct without any issue but it doesn't know which constructor to use --- you didn't give the parameter type to its constructor template... There is no way to tell compiler the type parameter of constructor before you call it. The best way is use U = T which gives the default parameter type, so ConditionalCtor x will let compiler know the type parameter of constructor ---- default to be int.
    But if the constructor template has U as its parameter type then you don't have to worry anything. ConditionalCtor x("hello") will let compiler to compile ConditionalCtor::ctor ...
    Anyway, if the constructor template does't has U as its parameter type, there is no way (as I know) to successfully compile ConditionalCtor x without claim the default type parameter.

  • @gatita_liliana
    @gatita_liliana 11 месяцев назад +1

    ahhhhhhhhhhhhhh great video

  • @minggai8582
    @minggai8582 2 месяца назад

    Xiexie, this helps a lot.

  • @pengliu9987
    @pengliu9987 6 месяцев назад +1

    Nice and informative video. One suggestion to the terminology of "subclass" at 14:45 (At ruclips.net/video/-Z7EOWVkb3M/видео.html). Things such as typename S::IpV4, S::IpV6 in C++ are called member type, while "subclass" typically means "derived class".

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

      You're correct! I hadn't noticed this until you mentioned it. Another term could be "nested class". 👍