C++ 11: Range Based For Loops

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

КОМЕНТАРІ • 10

  • @krantimadineni585
    @krantimadineni585 7 років тому +1

    Another great video...
    Sir, Can you please make one on smart pointers too...

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

    what are the benefits of using a range generator class over a standard for loop?

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

    i always enjoy your videos mate. any more directx stuff in the pipeline?

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

    so is the first parameter in a range based for loop called an iterator i noticed you called it "thing" or something like that and didnt know exactly what to call it.. just wondering if its different than an iterator or if its the same thing.

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

      +Christopher Jones It certainly iterates through the collection, so it is literally an iterator. But you can use these for loops to iterate through arrays as well, which
      don't have iterators like STL collections, so I'm not sure that the standard definition for a C++ iterator is quite right. Truth be told, I don't know the answer to your question. I can't see that you'd be wrong in calling it an iterator, but then I'm often wrong myself, and if you are able to find a solid answer, I'd love to hear it, this is an interesting question.
      Thanks for watching and commenting, and have a beautiful day!

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

    Nice video. However, I think it would be an improvement if you tried to change you slide texts from full sentences, which you almost always read out loud anyway, to short phrases or keywords. Because as it is now, at least for me, reading the sentence and simultaneously hearing you say it a second time is conflicting with each other. I either can read the sentence and ignore your voice for the time being, or listen to you but mostly ignore what is written on the slide.
    To give you an example on how I would try to change it, your slide "1. Similar Mechanisms" would look something like this:
    1. Similar Mechanisms
    (*) Microsoft offers "for each" syntax
    (*) Disadvantages:
    (>) no general compiler support (usage not recommended)
    (*) std::for_each, similar idea
    (*) Disadvantages
    (>) support only STD collections
    (>) requires algorithm header

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

    thanks good lecture.

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

      +Hojeong Lee Most welcome, thanks for stopping by!

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

    much love