C++ Function Templates

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

КОМЕНТАРІ • 27

  • @micosair
    @micosair 9 років тому +23

    This guys has such an Australian accent that a kangaroo jumped out from my screen.

  • @traderdox
    @traderdox 5 років тому +2

    Dude, your videos are amazing. Please keep making more.

  • @abdulwaheed6151
    @abdulwaheed6151 5 років тому +2

    You are good man and your voice reminds me of Aragon of middle earth.... Thank you

    • @WhatsACreel
      @WhatsACreel  5 років тому +1

      Hahaha, possibly the best thing anybody ever said to me! Thanks for watching brus, have a good one :)

  • @mikicerise6250
    @mikicerise6250 3 роки тому

    "This won't be on your exam" - if you only knew what our exams are like! xD Thanks, mate! Your videos are gold. :)

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

    Very nice tutorial. One of the best teacher around :-)

  • @leonhrad
    @leonhrad 9 років тому

    Unfortunately there are many different cases in templates, where type deduction is different, and the behaviour is often not what you'd expect. Scott Meyers has a great talk on this, called "Type deduction and why you care", and I really think it's worth knowing about that when using templates.

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

    I really love your style, you can perceive the preparation and work you put in your videos. Is there any chance you will make a new version of asm tutorials/serie? The old makes me cringe too much to follow it(audio/video/*shame*length)

  • @AnubhabHaldarChronum
    @AnubhabHaldarChronum 9 років тому +1

    Why does the template exe size matter?
    Suppose I had to define an int Swap, a float and a double Swap, I'd have 3 Swaps which the compiler would have to compile.
    If I wrote a template, and used int, float and double, it would still have to compile 3 Swaps.
    But then, it'll only make new datatype compilations for every new datatype used, which the programmer would do if it were done the way of overloading functions.
    So why does the template generate a larger exe?

    • @WhatsACreel
      @WhatsACreel  9 років тому +2

      +Anubhab Haldar You're right, it makes very little difference. I think template code is actually slightly smaller than lots of overloaded functions!
      I just wanted to point out that the function is not free. The compiler writes it for us.
      Thanks for watching and asking a great question!

  •  8 років тому

    Great video, thanks.

  • @epickittylover489
    @epickittylover489 9 років тому

    Hey whats a creel im aussie and im a big fan!

    • @WhatsACreel
      @WhatsACreel  9 років тому

      +epic_kitty_lover489 Cheers kitty!

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

    Sorry, I cannot find the function _Is_numeric in the head file , is it due to the update of the library?

  • @carlinconnell7715
    @carlinconnell7715 9 років тому

    Would have been cool to see some varidic templates.

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

    very helpful.

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

    You make me laugh with your comments!! :DDD

  • @syntaxed2
    @syntaxed2 7 років тому +2

    Codephile Dundee! :D

  • @jeffvenancius
    @jeffvenancius Рік тому

    It's almost like a macro(?)

  • @greywolf424
    @greywolf424 9 років тому

    So this is the same as Java generics

    • @AlessioSangalli
      @AlessioSangalli 3 роки тому

      I believe Java generics were implemented 10-15 years after C++ templates

  • @lifelonglearner4254
    @lifelonglearner4254 9 років тому

    dude templates a so awful, awful to debug, slows compiler... C++ template syntax is horrible, with all sorts of notorious problems with angle brackets and typename and other issues..Modern languages are so poorly designed that they hinder you more than they help when you are trying to actually program at a high level if you care about what the results are at the low level, which I do.