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

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

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

  • @leocelente
    @leocelente 3 года назад +11

    The fact that types "overrule" type deduction is something I wish I had learned the first time I heard about templates

  • @JobinAugustine
    @JobinAugustine Год назад +1

    Great presentation and content. I am not a C++ programmer by profession. But I learned so much from this. Thanks a lot.

  • @lisekSL
    @lisekSL 2 года назад

    51:30 UPDATE: c++17 standard added class template deduction types. I've checked, it works. Enjoy folks ;)

  • @YuTe3712
    @YuTe3712 8 лет назад +1

    Oh wow, thank you for fixing the title (bottom right)! Wasn't expecting a reupload and got excited thinking it was part 2. :')

  • @RedRumIzzy
    @RedRumIzzy 8 лет назад +10

    Great material and brilliant presenter! Really enjoyed the talk.

  • @IllumTheMessage
    @IllumTheMessage 8 лет назад +1

    Nice description of why templates are useful. Thanks for the talk.

  • @AtomkeySinclair
    @AtomkeySinclair 3 года назад +1

    Worth it for PRETTY_FUNCTION explanation. Neato.

  • @playerguy2
    @playerguy2 3 года назад +1

    1:07 ..wait, that's good, right?
    We write templates, sometimes for performance reasons.
    If not much time is spent doing meaningful work, then the this goal has been achieved.

  • @DevinSamarin
    @DevinSamarin 7 лет назад +4

    Part 2: ruclips.net/video/VIz6xBvwYd8/видео.html

  • @wpavada3247
    @wpavada3247 8 лет назад +2

    This would be much more interesting if pointer parameters to the function would be type deducted as well. In that case parameter passed can be both const type or const pointer.

  • @dans.5418
    @dans.5418 6 лет назад +4

    Not only a good content but an excellent presentation too. Thanks!

  • @Knuckler
    @Knuckler 6 лет назад +10

    34:21 "I'm going to assume some knowledge of lvalues and rvalues... it's been five years, people." This speaks to the ridiculousness of Rvalue References and move operations than anything else.

    • @IllIlIIllIlIl
      @IllIlIIllIlIl 6 лет назад +2

      I don't see what makes rvalue refs ridiculous. People haven't learned it yet because it is a (somewhat) complicated subject and a lot of people think they don't really need to understand it, which is not true since if you're programming in C++ you obviously care about performance which move semantics is all about, as well as allowing flexibility when copy constructors are deleted, for example.

    • @isodoubIet
      @isodoubIet 5 лет назад +3

      @@IllIlIIllIlIl Value categories aren't ridiculous. What's ridiculous is that said categories have to be defined on a case by case basis, so that either you get some imprecise intuition that's "good enough" for most cases (as the vast majority does), or you memorize all the rules, in which case I would encourage you to stay away from sharp objects because you're utterly mad. Surely this is just the kind of situation that merits the adjective "ridiculous". I'm not saying I have a better solution, but the language really is too complicated for its own good in this area.

  • @seditt5146
    @seditt5146 5 лет назад +2

    Is someone able to explain the is_void to me. I must have missed something because I do not understand how making T void has any bearing on the output here.

    • @ricardorey2714
      @ricardorey2714 5 лет назад +2

      Consider this:
      template
      bool is_void = std::is_same::value;
      int main() {
      std::cout

  • @allopeth
    @allopeth 5 лет назад +3

    Arthur you are f.... awesome!!!!!

  • @YasasCPerera
    @YasasCPerera 5 лет назад

    awesome talk. and whoever contributes to the subtitle, a great job.

  • @Slicc12345
    @Slicc12345 8 лет назад +2

    Where can i find the second Part :/?

    • @dresnyd
      @dresnyd 7 лет назад +2

      Should be in the right (PC) list as recommended videos that people watched after this. Among the first videos. Probably was too recently uploaded for YT to realize that at the time you watched this video.

    • @andersknatten
      @andersknatten 6 лет назад +7

      ruclips.net/video/VIz6xBvwYd8/видео.html

  • @TarunSingh-je9my
    @TarunSingh-je9my 5 лет назад

    Nice explanation.I have below doubt on iterator Why we need to provide specialization in iterator
    template
    void process(Iterator begin, Iterator end)
    {
    for (; itr != end; ++itr) {
    process(*itr);
    }
    }
    why i can't write
    void process(Iterator begin, Iterator end)
    {
    for (; itr != end; ++itr) {
    process(*itr);
    }
    }
    please explain

    • @yotty97
      @yotty97 5 лет назад

      Tarun Singh Iterator isn't a recognized type by itself, and there are different kinds of iterators based on type, so if yo wanted to specify a type there (without templates) you would be limiting the function to working on only one kind of interator

  • @notalexmarin
    @notalexmarin 6 лет назад +1

    love the guy

  • @michaelkohlhaas4427
    @michaelkohlhaas4427 6 лет назад

    *That what awesome!!!*

  • @victornoagbodji
    @victornoagbodji 8 лет назад +3

    where is part 2?

    • @andersknatten
      @andersknatten 6 лет назад +3

      ruclips.net/video/VIz6xBvwYd8/видео.html

  • @sivabudh
    @sivabudh 8 лет назад

    Can we now put template implementations in source as opposed to header files now?

    • @nlguillemot
      @nlguillemot 8 лет назад +2

      Yes. Look up extern templates.

    • @llothar68
      @llothar68 6 лет назад +1

      Are extern templates currently implemented in any compiler correctly?

    • @Quuxplusone
      @Quuxplusone 5 лет назад

      _Extern_ templates have been implemented correctly by everyone for decades now. This is covered in Part 2 of the talk: ruclips.net/video/VIz6xBvwYd8/видео.htmlm44s
      But this is not to be confused with "export templates." _Export_ templates were part of the C++98 paper standard, never got implemented, and were removed even from the paper standard in C++11.
      However, the short answer to Sivabudh's question is "No." I'm surprised that Nicolas said "Yes." Even if "Yes, extern templates" is _technically_ correct (see Part 2), it's not really what people usually mean when they complain about having to put their templates in header files. Extern templates are a niche solution to a niche problem.

  • @che8488
    @che8488 7 лет назад

    👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻