ITERATORS in C++

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 มิ.ย. 2024
  • The first 1000 people who click the link will get 2 free months of Skillshare Premium: skl.sh/thecherno08202
    Patreon ► / thecherno
    Merch ► chernothreads.com
    Instagram ► / thecherno
    Twitter ► / thecherno
    Discord ► thecherno.com/discord
    Series Playlist ► thecherno.com/cpp
    This video was sponsored by Skillshare.

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

  • @TheCherno
    @TheCherno  3 ปีที่แล้ว +66

    Thanks for watching! If you're after more, try and conditionally erase elements from your data structure while iterating over it, and make sure it works! Also don't forget to check out Skillshare - the first 1000 people who click the link will get 2 free months of Skillshare Premium: skl.sh/thecherno0820

    • @kadiyamsrikar9565
      @kadiyamsrikar9565 3 ปีที่แล้ว +1

      Hey cherno why don't you give your opinion on c++20 dropping support for iterators and adding modules

    • @battosaijenkins946
      @battosaijenkins946 3 ปีที่แล้ว +3

      @The Cherno, Yes THANK you for these kind of vids! I don't mean to sound like a complete prik but please, less of the dev reviews/opinions and more of the educational lessons of C++ like you used to upload back. You probably heard this a gazillion times but you are one of the best C++ explainers out there hands down~ Cheers.

    • @oracleoftroy
      @oracleoftroy 3 ปีที่แล้ว +4

      @@kadiyamsrikar9565 Uh what? C++20 renamed the old XIterator categories (e.g. InputIterator) to LegacyXIterator (e.g. LegacyInputIterator) and introduced a bunch of concepts to more explicitly categorize iterators. Modules has nothing to do with iterators, did you mean ranges? That doesn't replace iterators, but gives you a nicer set of algorithms that work on anything that models a range. Iterators are still there and aren't going away as far as I can tell. Even if ranges eventually replaces them, that will still be several years off.

    • @kadiyamsrikar9565
      @kadiyamsrikar9565 3 ปีที่แล้ว

      @@oracleoftroy your are right mate but c++20 is trying to increase the capabilities and usage of ranges. Module system is added in c++20

    • @kadiyamsrikar9565
      @kadiyamsrikar9565 3 ปีที่แล้ว

      @@oracleoftroy you are right mate but c++20 is trying to replace iterators and increase the capabilities of ranges . Module system is added in c++20 just like other modern languages.

  • @admiralspyro9722
    @admiralspyro9722 3 ปีที่แล้ว +376

    University: "As a CS student you will always have to learn the newest technologies."
    Also university: "Yea you gonna use c++-98, cause thats what the professor learned back in the day and he never bothered to update his lecture for 20 years."

    • @lordnoiado
      @lordnoiado 2 ปีที่แล้ว +8

      Shit, I was pretty annoyed that my current professor doesn't really code in C++20 (it's so good) but I guess it could be worse LMAO

    • @GalaxiaDeFavio
      @GalaxiaDeFavio ปีที่แล้ว

      @Danilo lol that exist?

    • @Ruhrpottpatriot
      @Ruhrpottpatriot ปีที่แล้ว

      @@GalaxiaDeFavio Yeah, like in the Linux Kernel who just recently switched over to GNUC11 after sticking to C89 for decades.

    • @user-ge2vc3rl1n
      @user-ge2vc3rl1n 11 หลายเดือนก่อน +3

      @@lordnoiado good luck finding a job that uses C++20

  • @corbinlenning3505
    @corbinlenning3505 3 ปีที่แล้ว +231

    Love how he mentioned university using c++ 2003 but I was using c++ 98 in my university and i graduated last year.

    • @bobthemagicmoose
      @bobthemagicmoose 3 ปีที่แล้ว +7

      Psh, we're using K&R c with nonstandard function prototypes (the project was something the prof did as a student 30 years ago)

    • @bennyc655
      @bennyc655 3 ปีที่แล้ว +13

      lol, while we learn a language call Racket, which no body use nowadays...

    • @MrCleverOnion
      @MrCleverOnion 3 ปีที่แล้ว

      What year did you graduate?

    • @corbinlenning3505
      @corbinlenning3505 3 ปีที่แล้ว +1

      @@MrCleverOnion July 2019

    • @lordnoiado
      @lordnoiado 2 ปีที่แล้ว +19

      @@corbinlenning3505 That's insane, my professor uses C++17 and I was already about to complain (C++20 has some great features), wow...

  • @saraswathishanmugamoorthy6751
    @saraswathishanmugamoorthy6751 3 ปีที่แล้ว +47

    I was recently given a C++ assessment for C++03, this was the first time a company interviewed me for such an old version. Seems like certain companies still have 20 years to catch up.

    • @muadrico
      @muadrico 3 ปีที่แล้ว +9

      I updated almost all code bases of all C++ projects in my company from using C++98 to C++17 in the last 5 years.

    • @badasahog
      @badasahog 3 ปีที่แล้ว

      actually 17 tho

  • @ebukaezike9308
    @ebukaezike9308 3 ปีที่แล้ว +166

    Me : What are iterators ?
    Cherno: Iterators are used to iterate .
    Me:.......
    Cherno: Sometimes my genius is ........ its almost frightening

    • @cp_200
      @cp_200 3 ปีที่แล้ว

      I can Feel You

    • @xephobia795
      @xephobia795 3 ปีที่แล้ว +7

      guys i'm gonna be honest...
      my brain is my brain

  • @magicweaponr072
    @magicweaponr072 3 ปีที่แล้ว +72

    As a JS developer learning C++, seeing the structured binding at the end made me smile. It literally looks the same, and in JS is called destructuring. Nice video

    • @mateuszabramek7015
      @mateuszabramek7015 3 ปีที่แล้ว +2

      Since TypeScript become popular, to JS were introduced many features from other languages because people from typed languages could understand JS easier and eg. node.js is written in c++. Than came ES6, ES7... Some implementations failed in my opinion like const, which is not really const when it comes to arrays or objects.

    • @magicweaponr072
      @magicweaponr072 3 ปีที่แล้ว +2

      @MyName Here lol. A big chunk of today's web servers are run on Node.JS, entire backends are written just in JavaScript and JavaScript derived technologies. I'd say javascript is as real of a programming language as C, C++, Rust, C#, whatever. Just higher level.

    • @astrotecn
      @astrotecn 3 ปีที่แล้ว +7

      @@magicweaponr072 nothing against higher level languages but javascript is specially garbage

    • @DoubleCoolOp
      @DoubleCoolOp 3 ปีที่แล้ว +2

      @@magicweaponr072 JavaScript is one of the worst languages ever invented, just like php.

    • @magicweaponr072
      @magicweaponr072 3 ปีที่แล้ว +3

      @@DoubleCoolOp well considering how nicely it's evolved and the ecosystem, and variety it's created, your opinion doesn't do it much justice, now does it? :)

  • @aqezzz
    @aqezzz 3 ปีที่แล้ว +1

    Another excellent video! I wish I had these when I was learning this stuff. Even though most of these are not new to me I never miss a single c++ series video because they are so well done. Keep it up!

  • @sebastianzander87
    @sebastianzander87 3 ปีที่แล้ว +11

    Another good reason to use iterators in basic data structures (that you could access by an index) is to have iterators with different behaviors e.g. a reverse iterator (trivial), an iterator that gives you the next random element or that accesses the elements in a specific order or that applies some filter function.

  • @rishitsingh6621
    @rishitsingh6621 3 ปีที่แล้ว +3

    Great! I was waiting for a good tutorial on this. Thanks Cherno.

  • @nextrie
    @nextrie 3 ปีที่แล้ว +2

    Brilliant tutorial on iterators, Cherno. Always good to have such refreshers!

  • @practicalsoftwaremarcus
    @practicalsoftwaremarcus 3 ปีที่แล้ว +10

    absolutely amazing video. Each video of yours make me love the language even more. I use it a lot in embedded systems and they way C++ elegantly interfaces with the hardware is simply beatiful .

    • @thestarinthesky_
      @thestarinthesky_ 3 ปีที่แล้ว +1

      I would like to work in embedded systems too in the future :)

    • @practicalsoftwaremarcus
      @practicalsoftwaremarcus 3 ปีที่แล้ว +1

      Best topic ever

    • @thestarinthesky_
      @thestarinthesky_ 3 ปีที่แล้ว +3

      @@practicalsoftwaremarcus Great! Which C++ framework should I know?Do you have any advice on being a professional in this field? What else should I learn except core C++ and standard library and data structures and algorithms in C++?

  • @rawgame
    @rawgame 3 ปีที่แล้ว +111

    Additionally, would be really useful to mention about the usage of the reference '&' for the iterator it self. I.e. instead of using "for (auto kv : map)" - using "for (const auto& kv : map)" would eliminate unnecessary copies when iterating.

    • @PrinceGupta-jo8lo
      @PrinceGupta-jo8lo 3 ปีที่แล้ว +2

      yeah, this is necessary

    • @TheMR-777
      @TheMR-777 3 ปีที่แล้ว

      True! I also use this technique to avoid copying

    • @matteorossillol7812
      @matteorossillol7812 3 ปีที่แล้ว +7

      Like said @Peterolen, `kv` is not an iterator here but a `value_type` (see the named requirement LegacyIterator for further information): e.i. the type of the dereferenced iterator. See the range-based for loop for more information about its operation. The `value_type` of `std::map` is `std::pair`, hence the possibility to use the C++17 syntax `auto [a, b] = pair;`.

    • @navjan13
      @navjan13 3 ปีที่แล้ว +1

      @@matteorossillol7812 @rawEngine's comment was regarding lthe auto at ine no. 40

    • @glitchgatsby4290
      @glitchgatsby4290 2 ปีที่แล้ว

      ooof, yeah, that sounds expensive with a bigger map

  • @3van660
    @3van660 3 ปีที่แล้ว

    You are too good man. Thanks for this, to the point and easy to understand, no bs.

  • @mattshu
    @mattshu 3 ปีที่แล้ว +19

    you make my self taught journey of c++ so much easier. Thank you so much

    • @ifracing
      @ifracing 2 ปีที่แล้ว

      hows its going the self taught journey? im currently in my 2nd month? i see its been a year for you now.

    • @epiram
      @epiram 2 ปีที่แล้ว

      @@ifracing breh

  • @raulyjimenez9167
    @raulyjimenez9167 ปีที่แล้ว

    This video is crafted overly well and i love it. Thank you for the thorough explanation of iterators.

  • @not_ever
    @not_ever 3 ปีที่แล้ว +67

    I feel kinda smug that my uni has made it all the way to C++ 11.

    • @LittleRainGames
      @LittleRainGames 3 ปีที่แล้ว

      atmel studio uses c++ 11, they are getting you ready for MCU programming

    • @not_ever
      @not_ever 3 ปีที่แล้ว +2

      @@LittleRainGames We program MCU in C, Assembly and C++ throughout uni, but have never used atmel studio for any of that.

    • @robert1200
      @robert1200 3 ปีที่แล้ว

      my university teaches us C++ 98

    • @zoriiginalx7544
      @zoriiginalx7544 2 ปีที่แล้ว +1

      C++11 is better than the new wacky standards anyway.

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

    Thanks a lot. I really like the way you explain the iterators. The examples are simple and clear.

  • @ZackSussmanMusic
    @ZackSussmanMusic 3 ปีที่แล้ว +1

    was waiting for this one!! Love this series, and that smooth sponsor transition

  • @sahilaujla8182
    @sahilaujla8182 3 ปีที่แล้ว +2

    Just started my journey of c++ by your playlist....am really really excited 😃

  • @NullLabs
    @NullLabs 3 ปีที่แล้ว

    Awesome overview! keep up the good work!

  • @Rahulsharma-rg8ce
    @Rahulsharma-rg8ce 9 หลายเดือนก่อน

    This is one of the best explanations of iterators I have seen, I was banging my head around google for so long! thanks

  • @zoltanujszaszi
    @zoltanujszaszi 3 ปีที่แล้ว

    Great explanation, as always!
    Waiting for the next episode!

  • @vivideradicator
    @vivideradicator 3 ปีที่แล้ว

    Excellent video, was worth watching the entire thing. Subscribed

  • @MichaelYoussry
    @MichaelYoussry 3 ปีที่แล้ว +14

    Note that the example with structured bindings will copy the elements. To iterate over a reference to the elements use:
    for (auto& [key, value] : map)

  • @juanma_cello
    @juanma_cello 2 ปีที่แล้ว

    This video is still GOLD. Thank you Cherno.
    Really useful.

  • @irfanjames6551
    @irfanjames6551 ปีที่แล้ว

    You teach soo much clearly and go just one step deeper

  • @KaruniaSentosa
    @KaruniaSentosa 3 ปีที่แล้ว

    I'm looking for this tutorial! Thank you for making this!

  • @soniamh8839
    @soniamh8839 3 ปีที่แล้ว

    i enjoyed watching every second of this tutorial. Thank you.

  • @ifelseprog
    @ifelseprog 3 ปีที่แล้ว

    For the video about iterators, an example about how it could be used for something different than iterating over a collection of element would be to iterate over a random class.
    Maybe you would construct with arguments about the range (min, max, number of values) and iterate through it, but the iterator would generate random numbers on the fly.

  • @dustink.5778
    @dustink.5778 3 ปีที่แล้ว

    Hey Cherno. Just want to leave some feedback to your videos:
    You are the BEST!!! Thanks a lot for your effort. You make it so easy to learn C++ and you are such a great character with always perfect hair :D!

  • @linternetsansfil4152
    @linternetsansfil4152 3 ปีที่แล้ว

    That's exactly the video I was waiting for !

  • @fuadcs22
    @fuadcs22 3 ปีที่แล้ว +50

    Make a short video of typing and shortcuts

    • @arsnakehert
      @arsnakehert 3 ปีที่แล้ว +1

      I personally use a vim plugin in every other editor, pretty handy stuff

  • @issaissa955
    @issaissa955 3 ปีที่แล้ว

    Thanks. I Was Looking For This

  • @majedalshaikhi
    @majedalshaikhi ปีที่แล้ว

    You made my day and just got a new subscriber

  • @vikbelthur
    @vikbelthur 3 ปีที่แล้ว

    Yes! I've been waiting for iterators !

  • @davidm.johnston8994
    @davidm.johnston8994 3 ปีที่แล้ว

    Thanks, very informative!

  • @jip96175
    @jip96175 3 ปีที่แล้ว

    Thank you. I learned a lot by watching your channel

  • @ivanpolyakov5746
    @ivanpolyakov5746 3 ปีที่แล้ว +1

    Hello! Great video! I think it would be interesting for you to make a video about how to implement a custom iterator for a custom STL compatible data structure (may be with some fancy algorithm). In the video you could touch something about template stuff and all these "using value_type = ", etc. Good luck! Looking forward to the new video!

  • @Minty_Meeo
    @Minty_Meeo 2 ปีที่แล้ว

    I have never seen or heard of C++17 structured bindings. I love learning new things about C++!

  • @cliffmathew
    @cliffmathew ปีที่แล้ว

    Thank you for clarifying this, which helped me make sense of it right away: Iterators appeared in the language because not all collections can be iterated over by an index.

  • @seifsallam143
    @seifsallam143 3 ปีที่แล้ว

    I fuckin love you. I was just looking for iterators and didn't find your video about it. Seriously, without you I would not have become as good as I am right now thank god. If I could sub to your patrion I would. Good luck with your work boi!!

  • @jimyang8824
    @jimyang8824 2 ปีที่แล้ว

    Nicely done! Thank you.

  • @edivaldopastorivalentini2600
    @edivaldopastorivalentini2600 3 ปีที่แล้ว

    Congratulations for channel. Video is much fine. Thank you for teaching. Peace and Health

  • @thehambone1454
    @thehambone1454 3 ปีที่แล้ว

    Thank you for still making programming tutorials (and hopefully more gfx!). I was afraid you wouldn’t after your reaction super stardom!

  • @EclecticVibe
    @EclecticVibe 3 ปีที่แล้ว

    Hey @TheCherno thanks for another great video! Can you also please make a video on different containers, and algorithms in c++, which are most commonly used.

  • @akiyprum
    @akiyprum ปีที่แล้ว

    Thank you so much for this video

  • @Negikusu
    @Negikusu 3 ปีที่แล้ว

    Thank you for the amazing videos :)

  • @sirenti9384
    @sirenti9384 3 ปีที่แล้ว +38

    For those watching for a good reference book: C++ primer is the way to go(imo.).

    • @snokzor
      @snokzor 3 ปีที่แล้ว +1

      it's very academic and I didn't like the bigger exercises and it goes very (too much?) into depth at times but it's a good book, yeah.

    • @snokzor
      @snokzor 3 ปีที่แล้ว

      one of the better ones out there to really get into it

    • @snokzor
      @snokzor 3 ปีที่แล้ว

      it doesn't go into multithreading and some other stuff tho

    • @ashishdandge5587
      @ashishdandge5587 3 ปีที่แล้ว +1

      My input is that this book is for those who are already familiar with programming and beginner to C++.

    • @rahulsriram6295
      @rahulsriram6295 3 ปีที่แล้ว +1

      "Sam's Teach Youself C++ in One Hour a day" is the best!

  • @huske16
    @huske16 3 ปีที่แล้ว +1

    I was just having a problem with this, thank you so much!

  • @user-qo9vt4kf9o
    @user-qo9vt4kf9o 3 ปีที่แล้ว

    nice work. As a student,i think that analyzing comlicated STL template design would be quite interesting.

  • @officialVIGNUM
    @officialVIGNUM 3 ปีที่แล้ว +4

    Expected to see operations between iterators, offsets and so on :)

  • @keris3920
    @keris3920 3 ปีที่แล้ว +3

    As a side note, ++it is generally more efficient than it++. The postfix operator has to create a temporary under the hood in addition to calling ++it.

    • @Borgilian
      @Borgilian 3 ปีที่แล้ว +1

      Not really... As far as I know, ++it used to be more efficient for looping through objects/data structures, and pointless for looping through arrays/vectors of primitives. Nowadays the compiler is optimizing it++ (if it's a modern one), so it gets similar performance to ++it. Still, might be good practice to continue differentiating it++ and ++it in code, since the compiler is not all knowing and might not optimize sometimes.

    • @keris3920
      @keris3920 3 ปีที่แล้ว +2

      @@Borgilian I say generally, because there are cases where that is not true. It is true, however, that ++it is at least as efficient as it++. It's not true that it++ is at least as efficient as ++it.

    • @sukhrajrandhawa5195
      @sukhrajrandhawa5195 3 ปีที่แล้ว +1

      @@Borgilian Using prefix is just good practice though. You should probably only use postfix in the cases where you need the temporary generated since that justifies it's use case.
      Other than that, you should always be using prefix whether the compiler will optimize the postfix or not.

  • @1973Washu
    @1973Washu 3 ปีที่แล้ว

    I am going over this area right now at university. So this is an especially useful tutorial.

  • @matthiassayler4637
    @matthiassayler4637 3 ปีที่แล้ว

    Perfect introduction! Thx for that! You're doing really well ;)

  • @kapilverma2668
    @kapilverma2668 3 ปีที่แล้ว +1

    It would be great to have a video on static code analyzers and sanitizers like address/thread sanitizers, cppcheck, sourcemonitor, etc.

  • @peter0702
    @peter0702 3 ปีที่แล้ว +3

    watch all the c++ videos in a week.
    omg Cherno, you somehow look young->old->young

  • @brunomiranda2239
    @brunomiranda2239 3 ปีที่แล้ว

    Very nice video! As a junior developer it helps me understand my colleagues code xD

  • @NavjotSingh-dy4iu
    @NavjotSingh-dy4iu 5 หลายเดือนก่อน +1

    We used turbo c++ in our college before we graduated in 2021. Stuff that has not been used since 1996. It makes the students hate this language. I really hope they update their system and their syllabus up to the current technology. Never had a lot of fun there 😅

  • @xiangli9588
    @xiangli9588 2 ปีที่แล้ว +1

    Thank you for the 70+ videos and the 20 sponsors from skillshare

  • @universalponcho
    @universalponcho 3 ปีที่แล้ว

    This was brilliant.

  • @etiennewijler6830
    @etiennewijler6830 3 ปีที่แล้ว +3

    Thanks once again for a highly informative video! Is there any significant speed difference between regular indexing and iterators on ordered data structures? For example, when I have multiple for loops running over arrays/matrices, would it be faster to use iterators and de-reference pointers or to obtain the values by the usual indexing?

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

    In a sense I felt like this was much more useful video for map than the actual map video. Or maybe I remember poorly. However I remember struggling with maps in 2018 or so. It was a terrible school task of STL containers where you had a nature park hiking routes with locations and you'd have to return the route with least elevation change between requested A and B. I'm still having nightmares from that, I just couldn't wrap my head around that. And another thing was nested maps...
    It was kinda funny to do the first C++ class in 2011 and the second right in 2018. A lot had changed but I had no idea, because even today the material for the first class is the same. The fundamentals don't change.
    So I guess I'd love to see more of those more advanced/complicated applications of these simple tools. Things that force you to think but also demonstrations of what's actually going on in there.

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

    Thank you

  • @gregwoolley
    @gregwoolley 3 ปีที่แล้ว

    Nice. Thank you!

  • @yousafsadiq3878
    @yousafsadiq3878 ปีที่แล้ว

    great lecture

  • @toast_on_toast1270
    @toast_on_toast1270 2 ปีที่แล้ว +2

    As a recent CS grad, I never quite understand when people say "my university used x language or version", because my university assignemnts (especially final year) were mostly generalized to whichever language you wanted to use. Aside from certain exceptions - for example groupwork, and my mobile apps course was taught in SwiftUI on a specific version of Xcode, for logistical reasons - this was the norm.
    Did/are other students experiencing a different kind of CS degree, perhaps more practical and less theoretical? Additionally, what is the merit of constraining students in this way?

  • @mahdies9620
    @mahdies9620 3 ปีที่แล้ว

    thank you sir

  • @ShivamJha00
    @ShivamJha00 3 ปีที่แล้ว +12

    0:27 yea and mine uses Turbo C which was released in 1993 when C++ wasn't even standardized

    • @mr.mirror1213
      @mr.mirror1213 3 ปีที่แล้ว +1

      Lol Indian problems boy (same here)

    • @codingsaroj18
      @codingsaroj18 3 ปีที่แล้ว

      yeah my school used turbo c++ in 8th class.

    • @kadblue2000
      @kadblue2000 3 ปีที่แล้ว

      @@codingsaroj18 same what a nightmare! The mouse pointer stopped working halfway through randomly then you had to save the file and restart using the keyboard. Notepad is better than turbo c++.

    • @Borgilian
      @Borgilian 3 ปีที่แล้ว +1

      C is actually lean enough for you to learn proper programming without all the OOP and C++ bullshit going on nowadays. You have an opportunity to learn how to code properly and in a way that favors the machine (performance).

  • @gurmeharsingh1485
    @gurmeharsingh1485 3 ปีที่แล้ว

    cherno literally saving me through online school

  • @theNeuo13
    @theNeuo13 2 ปีที่แล้ว

    thanks for the video. About the last two methods, is there versions of them to iterate to a certain position of the map and not to the full range of it?

  • @swapnilbhave3767
    @swapnilbhave3767 3 ปีที่แล้ว

    Awesome video

  • @_sevelin
    @_sevelin 3 ปีที่แล้ว

    Nice video. Can you discuss the new features of C++20?

  • @alecabuan6674
    @alecabuan6674 2 ปีที่แล้ว

    This guy is saving my unilife

  • @balaeinstein8710
    @balaeinstein8710 3 ปีที่แล้ว

    hi cherno . are you planning to do a separate series of videos on c++ STL?

  • @arthurmorgan923
    @arthurmorgan923 3 ปีที่แล้ว +8

    I am learning c++ with a book called C++ in One Hour a Day. And when i confuse, don't get something, i know where to go. Your videos are AMAZING. Hope that your videos can reach more people.

    • @ibrakap
      @ibrakap 3 ปีที่แล้ว +1

      Yerini biliyorsun reis :D

  • @brennethd5391
    @brennethd5391 2 ปีที่แล้ว +1

    8:00 i would recommend you write ++it instead of it++ because its more efficient in iterators

  • @mehdishokohifar3476
    @mehdishokohifar3476 3 ปีที่แล้ว

    Cherno, make video about rust vs cpp and Point to the claims of the rust language that all other things can be applied to the Cpp.
    For example, writing code that adheres to smart pointers(unique_ptr)
    And shared ptr for secure concurrent context.
    My suggestion is to build a library that has all these things together under the name secpp, for example.

  • @KurtQuad
    @KurtQuad 3 ปีที่แล้ว

    Time warp - I remember trying to code a card game in Turbo Pascal during computer science in the year 1986/87 I believe. That was not easy at all.

  • @princekm5902
    @princekm5902 2 ปีที่แล้ว

    Iterators are used extensively in stl algorithms library.

  • @jesseburstrom5920
    @jesseburstrom5920 3 ปีที่แล้ว

    Note on Game Engine: I make my 'Game Engine' in Flutter/Node.js/Sql etc... I make it fully multi interactive say Yatzee full functions etc. Then i have idea it would be easy to replace the Yatzee with say Chess and if good game engine it would be more or less easy to implement. My real idea is that when games came about in the beginning most where full programs not much to backup change since each program is isolated. Forward Amiga came with operating system where games could use the operating system simplifying the game structure. Forward more things are given to the game engine so the switch between games made simple. My idea is that a good game engine provides all most important features so ease of new creation.

  • @Markgraf_ON
    @Markgraf_ON 3 ปีที่แล้ว +6

    I'm really waiting for the exception in C++ class....

  • @VoixDeLaNation
    @VoixDeLaNation ปีที่แล้ว

    For school I have to compile in C++ 98 😅 Really useful stuff! But i'll remember this video after my class.

  • @sachinpandhare8737
    @sachinpandhare8737 3 ปีที่แล้ว +2

    Last for loop for map should be like below
    for( const auto& [ key, value ] : map )

  • @spookyman9994
    @spookyman9994 3 ปีที่แล้ว

    would love to give your thoughts on the hot chip 2020 for the Xbox Series X .
    i mean you talked about the great mark cerny presentation , now its Microsoft turn .

  • @perewong2499
    @perewong2499 3 ปีที่แล้ว

    Hey Cherno, can you talk about the y_combinator and the best implementation in c++17?

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

    My uni was C++11 last I took the classes. And I thought that was a bit outdated…

  • @mateuszabramek7015
    @mateuszabramek7015 3 ปีที่แล้ว +1

    Thematically next would be ranges.

  • @koonhanong2267
    @koonhanong2267 3 ปีที่แล้ว +1

    auto is amazing

  • @dinmukhamedzardykhan5815
    @dinmukhamedzardykhan5815 2 ปีที่แล้ว

    Beautiful

  • @horanj.1022
    @horanj.1022 4 หลายเดือนก่อน

    Please make a video of making a c++ class that's iterable and define all the required methods. Thanks

  • @michaelhernandez2075
    @michaelhernandez2075 2 ปีที่แล้ว

    I was told we are doing this is college because they have to show us the theory along with the way things actually work. You arent "supposed" to do certain things without knowing how they work first according to the colleges.

  • @Manjuju123
    @Manjuju123 ปีที่แล้ว

    Is it also true that the iterator reduces the number of implementations in the algorithm library? I heard it allows the algorithms to traverse on any container type.

  • @coltonhill272
    @coltonhill272 3 ปีที่แล้ว

    Wish I knew about this 2 months ago. I had to write a compiler for class that used this everywhere. Normal when I write code, I already feel like a monkey on a typewriter trying to recreate Shakespeare. But after watching this, I think I need to burn and bury my code to atone for the shame.

  • @blank-vw2sb
    @blank-vw2sb 3 ปีที่แล้ว +1

    10:47
    My man, rhyming.
    "I wanna iterate through it,
    How would I do it?"

  • @ss-btw
    @ss-btw 10 หลายเดือนก่อน +1

    I can only say that I really like you and your class!🤒🥳

  • @damiengates7581
    @damiengates7581 3 ปีที่แล้ว

    it's unbelievable how there's no documentation about this

  • @jayavamsikrishnamnaiduallu4358
    @jayavamsikrishnamnaiduallu4358 3 ปีที่แล้ว

    Your teaching is amazing but from where do you learn all this stuff(c++, Java, game engines, etc.). Please tell me

  • @Waseek69Ahmad
    @Waseek69Ahmad ปีที่แล้ว

    10:45
    Cherno: I don't use CPP, CPP uses me.

  • @manavshah5527
    @manavshah5527 2 ปีที่แล้ว

    Gold!

  • @michaeljburt
    @michaeljburt 3 ปีที่แล้ว +8

    Dude, you are a fantastic communicator. Far better teaching as compared with CS lectures that I've taken.