CppCon 2016: Arthur O'Dwyer “Template Normal Programming (part 2 of 2)"

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 23

  • @utki17
    @utki17 6 років тому +9

    Need to watch this at least 3 times before it sinks in !

  • @mohammadsadeghzadeh6739
    @mohammadsadeghzadeh6739 4 місяці тому

    The first time I listened to it, I fell asleep 😂 let's go for the next step

  • @vladislavkaplan3738
    @vladislavkaplan3738 8 років тому +5

    Real useful stuff. Thank you very much.

  • @Skeksis0
    @Skeksis0 Рік тому +1

    14m:33s Arthur says function templates can't be partially specialized, but it appears what he is demonstrating here is actually function overloading. (Not that this takes away from the following implementation: tag dispatch is the right solution here.)

  • @perfumedsea
    @perfumedsea 4 роки тому

    very useful presentation and a lot of useful techniques.

  • @xealit
    @xealit 5 місяців тому

    38:20 variadic templates

  • @lukasz2345
    @lukasz2345 8 років тому +2

    can't get this exaplest to work with clang3.9 ;]

  • @pleiadiblu2365
    @pleiadiblu2365 2 роки тому

    Well structured presentation, one step at a time. However, especially the second part is a little rushed through, which makes it hard to follow.

  • @tombranson9341
    @tombranson9341 4 роки тому +1

    Good stuff, but showing the difference of template instantiation and initialization was horrifically confusing.

  • @thedzu
    @thedzu 5 років тому +9

    Too complicated to be useful. Imagine how much time we need to code review and debug. Subtle differences can cause dramatic changes. Still this is a very helpful and informative talk. Most C++ books just includes a very brief intro to template programming, as if it is so easy to use. In fact it’s not.

  • @michaelkohlhaas4427
    @michaelkohlhaas4427 6 років тому

    *Awesome! Thank you!*

  • @xealit
    @xealit 6 місяців тому

    Damn. I was looking for Scott Meyers or this guy to talk about CRTP and he just skipped the pattern...

  • @yuehuajia3176
    @yuehuajia3176 7 років тому

    Great Talk!

  • @MrSapps
    @MrSapps 8 років тому +2

    You need to book more time dude! Good stuff though.

  • @mikakulwant
    @mikakulwant 7 років тому +11

    It is horribly complex.

  • @andreaspokorny3089
    @andreaspokorny3089 5 років тому

    Dont say "call it" when all the phones in the room are listening you.. I wonder who had "it" in the contacts?

  • @Forritouno
    @Forritouno 8 років тому +2

    Templates still look like black magic to me :/.

  • @origamibulldoser1618
    @origamibulldoser1618 8 років тому +6

    Sigh.... No. No, no, no.

    • @alexparker7791
      @alexparker7791 8 років тому

      What's wrong?

    • @origamibulldoser1618
      @origamibulldoser1618 8 років тому +13

      Same old song, I'm sorry to say.
      It doesn't mesh well with the compilation model. I mean, come on... header only, or write the declaration, declare the specialization, then specialize in the translation unit? Isn't that at best a really verbose work-around because of the compilation model?
      The syntax is too verbose. Put simply, it's a shame people discovered all these admittedly useful techniques and made them "legacy" before someone had time to redesign templates and produce a moderately palatable language feature. There's no doubt in my mind that a modern language needs a reasonable way to process types, but this can't be the right way to do it.
      The cognitive load of actually using templates is too high for an average programmer such as myself. The complexity is so staggering I can't even recall what this supposed tool is supposed to help me solve.
      It's an interesting puzzle, the more advanced C++ stuff, and that makes it fun in its own right, but not very productive. Maybe I'll look into it when I'm retired and have infinite time to get lost in the details.
      This is a great talk, though.

    • @alexparker7791
      @alexparker7791 8 років тому +2

      What if we were able to abandon all the legacy and start anew; what would such a template system look like?

    • @leeux
      @leeux 8 років тому +8

      You should think of the template meta-programming machinery as a functional sub-language within the C++ itself.
      If you can solve a problem by applying a functional approach, odds are that the same solution can be applied as C++ templates too, where you represent actual values of the problem domain as the types themselves, while the "code" is executed by the compiler itself... weird-ugly-syntax notwithstanding :)
      Also the other part of the problem you mentioned, header only etc... it should be different (and solved, maybe?) when they release C++ modules at last.