Live Coding // C++ Template Meta Programming

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

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

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

    I'm so glad that concepts and _if constexpr_ have given a more readable alternative to SFINAE and messy type traits like enable_if; and that contexpr functions have mostly obsoleted recursive TMP by making compile time code look like runtime code.
    I recently replaced a couple of recursive TMP functions that filled some arrays with the results of recursive formulae with a single constexpr function and it was such a pleasure. An likewise, I replaced a class that had several template specialisations but was mostly similar with a few if constexprs.

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

    Glad I had some time to rewatch it, unique2 was something I've never seen before!

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

    Always fun to hang out with you and people in chat. Had a blast last evening :)

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

    it wasn't touched on during the stream, and i wasn't able to watch live, so i'll ask here:
    what's the benefit (if any) of the seemingly more complex "unique2" function, compared to the simpler recursive "unique" version?
    are there other use cases where such an implementation could be more beneficial?

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

      Benefit is a somewhat relative term. I just wanted to showcase multiple ways of doing it and how you can leverage standard algorithms in a constexpr context

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

      @@nathanbaggs i see, thanks