Writing an ITERATOR in C++

Data is everywhere! Enhance your career and acquire new skills by taking a course on DataCamp! Click here to take the first chapter of any course for FREE: bit.ly/2ZrYE6O (you’ll be supporting my channel too!)
Patreon ► / thecherno
Instagram ► / thecherno
Twitter ► / thecherno
Discord ► thecherno.com/discord
Series Playlist ► thecherno.com/cpp
This video is sponsored by DataCamp.

Пікірлер: 162

  • @TheCherno
    @TheCherno3 жыл бұрын

    Thanks for watching! ❤️ Data is everywhere! Enhance your career and acquire new skills by taking a course on DataCamp! Click here to take the first chapter of any course for FREE: bit.ly/2ZrYE6O (you’ll be supporting my channel too!)

  • @phoenixjauregui5508

    @phoenixjauregui5508

    3 жыл бұрын

    I first learned programming through DataCamp. Great sponsor!

  • @muhammedyasinhanyasar539
    @muhammedyasinhanyasar5393 жыл бұрын

    When I learn all C++17 features, C++34 going to be released.

  • @lapatatadelplato6520

    @lapatatadelplato6520

    Жыл бұрын

    I don’t understand all that your saying, just what I can understand

  • @LOL-cp6js

    @LOL-cp6js

    Жыл бұрын

    First time?🌚😂

  • @mihevoct5624

    @mihevoct5624

    Жыл бұрын

    Same

  • @lainproliant
    @lainproliant3 жыл бұрын

    I'm a fairly seasoned C++ developer, having been using it since 2000. I enjoy your videos simply because I like to know how things are being taught today, and I like having a window into the game development world. Watching other people write and talk about code is also helpful for motivation!

  • @godnyx117

    @godnyx117

    3 жыл бұрын

    Lol! I was born in 2001. How old are you?

  • @AlFredo-sx2yy

    @AlFredo-sx2yy

    2 жыл бұрын

    @@godnyx117 now a year older than back when you asked :V

  • @godnyx117

    @godnyx117

    2 жыл бұрын

    @@AlFredo-sx2yy Lol, you are not wrong!

  • @roeetoledano6242

    @roeetoledano6242

    5 ай бұрын

    @@AlFredo-sx2yy now 2 years...

  • @mequint2000
    @mequint20003 жыл бұрын

    I once had an interview at 343 and one of the questions the interviewers asked me was to write an iterator for a tree data structure. Up to that point, I had never written an iterator in C++ not to mention for a less common DS, so I struggled through it. Didn't get the job but I remember the experience. Those who are watching - learn this! It may help land you a job in the industry. Thank you for this video - I found both the thought process and the code exercise useful!

  • @NordicFrog

    @NordicFrog

    3 жыл бұрын

    Did you actually interview at 343? The 343. That's cool, even if you did not get the job.

  • @godnyx117

    @godnyx117

    3 жыл бұрын

    Of course you didn't got the job! There is a reason people call them 343tard!

  • @dhruvgupta8747

    @dhruvgupta8747

    2 жыл бұрын

    Happened to me too a few days ago when interviewing for NVIDIA. Had to write an iterator for a linked list class but had no idea about how to write iterators :(

  • @davidb4020
    @davidb40203 жыл бұрын

    Funny I just did an exam where I wished I had more knowledge on iterators and then decided to try and find more resources. Lo and behold! New video from the Cherno on iterators.

  • @StevenQiang

    @StevenQiang

    3 жыл бұрын

    comp6771?

  • @Sami-df7dj

    @Sami-df7dj

    3 жыл бұрын

    What did you get on the exam? Just curious see how well Cherno has taught you.

  • @jyliang2987

    @jyliang2987

    Жыл бұрын

    @@StevenQiang Watching this video for my assignment 2

  • @StevenQiang

    @StevenQiang

    Жыл бұрын

    @@jyliang2987 Good luck with your assignment😆

  • @PwnySlaystation01
    @PwnySlaystation013 жыл бұрын

    I'm all for reading code to learn, but my god, the STL seems like it was written as part of a contest to see who could write the most obfuscated and difficult to understand code.

  • @PwnySlaystation01

    @PwnySlaystation01

    3 жыл бұрын

    Haha just got to the part where you mentioned this yourself

  • @jessprogany4345
    @jessprogany43453 жыл бұрын

    I always love when you explain library code

  • @mockingbird3809
    @mockingbird38093 жыл бұрын

    Exactly what I was waiting for. Thanks, Cherno! Waiting for more C++ DS Videos!

  • @isaactong3054
    @isaactong30543 жыл бұрын

    I've been waiting for this video for quite a while. Thank you Cherno!

  • @kryt7955
    @kryt79559 ай бұрын

    I love how you actually think about our learning experience and worry about it as a mentor would. Love you man. Keep up the great work!

  • @joymakerRC
    @joymakerRC Жыл бұрын

    dude you are awesome , thanks , i needed you , and you came to me. so grateful

  • @sathyababu9130
    @sathyababu9130 Жыл бұрын

    "2:51 I pull my Heart and soul into my Videos " Words uttered from your subconcious mind, your efforts, burning desire towards tech. will take yoiu a long way, I watched couple of your videos, I'm so impressed by the way you deliver. Bridge the gap between a novice developer and an architect. I can see you there. God bless you Cherno.

  • @Devilextremeful
    @Devilextremeful Жыл бұрын

    Thanks; this was really useful and straight to the point.

  • @bulentgercek
    @bulentgercek3 жыл бұрын

    Great as always. Much love.

  • @joachimhodara575
    @joachimhodara5753 жыл бұрын

    Thanks for your videos, always nice to watch! Question: why implement VectorIterator instead of Iterator as a nested non-templated class in Vector? Is it because you could technically reuse it for another Array class (or any other random access container)?

  • @BetaNegative

    @BetaNegative

    3 жыл бұрын

    I was wondering this too.

  • @user-cy1rm5vb7i
    @user-cy1rm5vb7i3 жыл бұрын

    one day I was struggling with template argument lists, so I just opened the std::thread implementation in Visual Studio and copypasted a lot of code, tinkering with it. It helped a lot in understanding reference forwarding, storing arg lists in tuples and then invoking callbacks from that tuples. And now I've even managed to make a constrained template tuple-based hash-table for passing some data to the lua-machine.

  • @mario7501
    @mario75013 жыл бұрын

    I actually wrote my own vector class a couple of years ago and had the exact same issue with non primitive types. Took ages to figure out what was going wrong :D

  • @bharanidharans5857
    @bharanidharans58572 жыл бұрын

    Thanks for clear explanation and I tried implementing the customer iterator. I feel happy. Now I am able to understand the backends of STLs in effective manner. Thanks a lot. Please do post video for internal implementation of Maps, Multimap

  • @lukasz_kostka
    @lukasz_kostka Жыл бұрын

    You've just explained this in shortest possible way for me. It works ! THX. I'd post a link to godbolt but youtube .....

  • @ibraheeminam4982
    @ibraheeminam49823 жыл бұрын

    Thank you so much for your amazing lectures. Would you please make an introductory lecture on Boost Library? Where should we use it? Also please make a video on different ways to design the code architecture in different types of large projects. Like thread based, or state machines based etc. Lastly, the c++ coding standards. I couldn't find good content on these topics so far. Thanks.

  • @krisitak

    @krisitak

    3 жыл бұрын

    Search for Bo Qian in youtube. Cherno + Bo Qian are one of the best C++ channels out there. Bo Qian covers the topics you asked for.

  • @leocarvalho8051
    @leocarvalho80513 жыл бұрын

    Hi Cherno. Kudos from cape verde. Please make a series on popular projects code walktrough

  • @LetsDark
    @LetsDark2 жыл бұрын

    I would love a video about Iterators with a complex type, like a graph (a tree or something like hat). Everything in this video was easy, but what do you do, if you have to make a decision in the operator++? E.g. go to the child element or to a neighbor? And how do you track, which decision you made where? Lets say you go to the childs first, then you have to get the first neighbor after the last child. How do I do this, without creating a very complex iterator that has to track everything somehow?

  • @kicchu15
    @kicchu153 жыл бұрын

    Hello Cherno your videos are great. Also it would be great if you can possibly post some videos on Design patterns and Data Structures.

  • @YRBYD
    @YRBYD3 жыл бұрын

    Great Video! Is your VS color scheme somewhere available for download? Really like it

  • @alltheway99
    @alltheway993 жыл бұрын

    Long time no see 😂 You have a backlog of c++ topics you have to catch up man 🙂

  • @ianpan0102
    @ianpan01023 жыл бұрын

    Question: If we don't write "using ValueType = T" in the Vector class, is there any way for us to use Vector::T in the VectorIterator class?

  • @amantiwari4736
    @amantiwari47363 жыл бұрын

    please do a DS full series 😍😍

  • @hhehe24
    @hhehe24 Жыл бұрын

    2:50 this is incredibly helpful as an aid for a uni course, for me at least; very helpful

  • @nextwave5164
    @nextwave51643 жыл бұрын

    How I taught myself to code was to find some code examples then hack it apart to do what I wanted. Lots of headaches and lots of yahoos with that lol

  • @mattiacolombo6246
    @mattiacolombo62462 жыл бұрын

    I can never thank you enough for your work on this series. I wanted to ask something, at 16:33, about the postfix operator. Shouldn't you make operator++(int) returning const VectorIterator instead of just VectorIterator, to prevent users from concatenating them like it++++? Since returning a const VectorIterator, you'd disable all non-const methods, making any subsequent ++ illegal. Not sure if the same logic applies to the prefix operator...

  • @Brick-il8on
    @Brick-il8on2 ай бұрын

    There are no subtitles in this issue. If you can cherno, thank you for adding it.

  • @lerdi
    @lerdi2 жыл бұрын

    That keyboard typing is just soo satisfying

  • @eduardovaldez4013
    @eduardovaldez40132 жыл бұрын

    quick question chenro, how do you get that color theme for your Visual studio. Mostly how do you change the colour of clases and strucutres. I unfortunately have to use Visual Studio at work instead of VS code so I'm a bit lost. I find that changing the colours really helps me keep track of what my code is doing.

  • @timhaynes6735
    @timhaynes6735 Жыл бұрын

    Thanks Cherno - this is a nice "quick and dirty" implementation. For people interested to make solid safe real versions of the nice example here you must also: 1. add some protective code to prevent the increment/decrement operators from running off the ends of the array. 2. Decide how you want to handle dereferencing an iterator that is "invalid" (as well as pointer access). With a little work to tidy it up you can have a safe version. Mine currently will stop decrementing and "stay" on the first valid array value if you try to decrement off the end. I'm still thinking about best approaches and may test out the std behavior and just mimic same behaviors.

  • @timhaynes6735

    @timhaynes6735

    Жыл бұрын

    Also - implementing the operator[ ] on the iterator itself is not conventional and would be confusing IMO. There's likely an operator [ ] on your container "itself" if it makes sense for that kind of container

  • @Byynx
    @Byynx2 ай бұрын

    Could someone explain me what the scope resolution operator :: is doing before the call of some operator() functions? Like ::operator new()

  • @codingsaroj18
    @codingsaroj183 жыл бұрын

    I once wrote a unified style iterator that works for all data structures but it needed some functions to be implemented in the data structures. What's the advantage of a specific iterator over a common iterator?

  • @xardinlume7345
    @xardinlume73452 жыл бұрын

    I usually try to check the standard libraries, but all the macros, debug, fancy underscores... it all just makes it confusing. So thanks for decrypting it.

  • @MaxRaskin
    @MaxRaskin3 жыл бұрын

    HI, thanks for the neat tutorial! There's one minor bug in your prefix operator implementation - is implemented in terms of a postfix operator, should be ++m_Ptr instead of m_Ptr++; Cheers

  • @oscarahlke1585
    @oscarahlke15853 жыл бұрын

    Hey man! First I wanted to tell you, that I really appreciate your tutorials man! But my question to the typenames is: Why do you have to create always a new pair of shoes? For example ... ReferenceType = T& Why not just typing T over and over again? Or has it something to do with the inheritance of classes? Thank you for your answer already! :-) And, even though Corona shatters the normal life: Merry Christmas!

  • @stepanhrbek8151

    @stepanhrbek8151

    3 жыл бұрын

    Hello, I am not expert at the topic, but I think it just makes the code more readable (probably not for everyone though). Have a good day!

  • @Yupppi
    @Yupppi7 ай бұрын

    People just don't usually send me some good code they made to solve some industry problem that is at all readable. I'm not saying one of those things don't happen in the chain of events, none of those things exist in my life. So as a beginner I'm slightly lacking the source. And often times it also happens that you're trying to find a syntax for a simple problem you're trying to solve and think you know the way logically, but you're missing the correct syntax, and you find stack overflow doing some crazy convoluted method to what can be solved with a short line of code. I'm at the level where I've never had to allocate to heap even though I've learned to do that. It's not quite the tools missing but applications. For most of my uses I'm interested in collecting a bit of information from the user or file, then operating on them and printing the results out. The biggest interest often is "how do I do this arithmetic operation chain in compact length with efficiency". Or "how on earth will I 1. make a matrix and print it 2. solve making an intuitive interface for inputing a matrix in prompt 3. do matrix calculations without writing painstaking manual element by element chain of loops or picking elements by hand 4. how do I generalize it for more than my template size matrix" etc. Your operator overload (conveniently as a demonstration of x, y, z struct that represented a vector) solved the printing for virtually any custom class neatly inside the code. Also I saw a compact method from std libraries to sum the rows together as if you did M*(1, 1, 1) matrix calculation similar to some example exercises on vector math classes. But I also saw a demonstration of how you'd do nxn matrix multiplied with nxn matrix and got upset at like 5 nested for loops that you'd manually make to iterate through everything in the matrix (supposedly making it like 100 times slower than individual arithmetic operations would predict due to the way of using cache). This is just semantics or philosophical pondering, not personally aimed to criticize or anything like that (all the videos are highly helpful) but don't you find it funny to state that most students have the issue of relying on documentation and videos when they should be reading real code and how the standard library does things, and also saying that when you wrote an iterator, you hadn't been taught it. In a video you released to demonstrate to people how to do it and giving tools to write and make things with code. I agree that you're correct in what you say, but what you do is immensely helpful, because I barely have time to sleep in engineering school and I assure you, learning C++ past very basics that allows you to write simple crude programs to maybe help you with some school tasks is not the priority. Without these videos I either wouldn't get a better understanding on C++ or I'd spent most of my time trying to understand stuff like CPPreference and bang my head against the wall to try to get some things to work and get no school work and studying done. Lastly after all the rambling, I must say I love the hue of orange your Visual Studio has. I'm using VS Code because it seemed like the best combo for me: doesn't take ages to open up and seemingly have a lot of weight pulled around when you try to use it, but similar enough to Visual Studio with all the convenient editing help and tools. However it has in some sense quite pastel, light and faded. And I'm really struggling to customize it for now, there's no color map outside the template themes where you could just choose the type of thing to color and choose the color, it just throws you in an empty .json to write your own definitions in who knows what syntax. That's a future project, to make it look pleasantly vivid like your Visual Studio. Funnily enough VSC made sure I noticed from the coloring of the words that there was a } missing where you had it, everything was just grey instead of the variable colors because it would no longer declare the m_Data, m_size and m_Capacity.

  • @kamkamkil1
    @kamkamkil13 жыл бұрын

    hi are you going to make video about the newer iterator introduced in cpp20 ? i mean with tags and everything

  • @mallasarjsulebhanvi4128
    @mallasarjsulebhanvi412810 ай бұрын

    Thanks Cherno, It was really a good learning experience

  • @peternjorogej
    @peternjorogej3 жыл бұрын

    How about linked lists (std::list) next? I would really like to see how iterators would work with data structures such as lists😅...

  • @marilynwen7179
    @marilynwen71792 жыл бұрын

    Does anyone know if he shares the code to the public and where that is? Thanks!!

  • @linternetsansfil4152
    @linternetsansfil41523 жыл бұрын

    You can use std::construct_at() or something similar instead of placement new, it looks cleaner. Could you make a video for how to implement a property class without any overhead ?

  • @prajyotgajane1528
    @prajyotgajane15283 жыл бұрын

    Please make a video on allocator's !!!

  • @BiteSizeInfo.
    @BiteSizeInfo.7 ай бұрын

    @TheCherno Can you please some videos on implementation of DS

  • @paulzupan3732
    @paulzupan373210 ай бұрын

    Is there any reason not to just use emplace_back all the time, since it’s more efficient?

  • @itihaasa9061
    @itihaasa90613 жыл бұрын

    Can someone please share the link where implementation of vector or for that matter entire STL can be found.

  • @Alexino-xi1mn
    @Alexino-xi1mn3 жыл бұрын

    I'm a beginner ,and i'm far behind with the vids but i wanted to ask you if you could show us how can we implement all the things you showed us in the proces of making a simple game.

  • @korara3508
    @korara35082 жыл бұрын

    why Vector::ValueType is used .I don't understand the syntax .I mean I only know that Classname::something is used when something is static in that class.Can anyone please explain that to me.thank you very much!

  • @strangeruler2317

    @strangeruler2317

    Жыл бұрын

    Same question

  • @baardi2
    @baardi23 жыл бұрын

    Whats up with indexing on the iterator? What's that useful for?

  • @nguyenacquan2977
    @nguyenacquan29772 жыл бұрын

    why dont you realocate memory in Vector class by some magic like memcpy and just call operator delete( ptr, ...) later , it will assume the ptr you pass in is a void pointer so it will not call the destructor anyway

  • @pavelperina7629
    @pavelperina76293 жыл бұрын

    Have someone tried alternatives to std library and compare performance and compile times? AFAIK it's much faster in gcc/clang debug builds than in msvc, cause msvc version does many checks in debug and some of them are (i think) even locking some mutexes. But there are other implementations such as eastd

  • @Phroggster
    @Phroggster3 жыл бұрын

    That was a pretty good intro to iterators, as well as how to use them for enumerating data types. I do wish that you'd have kept the _NODISCARD macros intact as well as all the const mechanisms that the MSVC implementation provides as they can help catch problems early on as well as increase performance. But again, entry-level, I understand why most of that stuff was omitted. I hope that you, the person reading this whomever you may be, are doing well.

  • @SumoCumLoudly

    @SumoCumLoudly

    3 жыл бұрын

    I think its a terrible intro, hes jumping around all over the place of existing code without explaining anything really. "Lets make this a template" and gives no insight as to why, its pretty much copy and paste stuff and poorly done as a stand-alone video. Get the impression her doesnt fully understand them himself but is just making it work.

  • @AlFredo-sx2yy

    @AlFredo-sx2yy

    2 жыл бұрын

    @@SumoCumLoudly gotta fully agree with you, this has to be the first vid i've seen where cherno actually seems to be copy pasting stuff without actually getting what is going on under the hood. Shameful display tbh.

  • @daniilmurray3751
    @daniilmurray37513 жыл бұрын

    FINALLY.

  • @darshitnasit3130
    @darshitnasit31303 жыл бұрын

    Can anyone explain why at 11:24 he has use using ValueType = typename Vector::ValueType ?? Why we can't use using ValueType = Vector::ValueType

  • @damnstupidoldidiot8776

    @damnstupidoldidiot8776

    3 жыл бұрын

    I have no idea, but you kind of just do, the compiler will throw an error and tell you to put typename.

  • @mequint2000

    @mequint2000

    3 жыл бұрын

    My understanding is that the Vector::ValueType is a templated type defined when the template is instantiated. The iterator relies on the typename specifically, not the type. Therefore, the 'typename' keyword is necessary to ensure that the iterator and the container the iterator is working on is in sync. Search 'C++ typename' for further details.

  • @user-cy1rm5vb7i

    @user-cy1rm5vb7i

    3 жыл бұрын

    @@mequint2000 idk, if the only practical way of getting the iterator is using begin/end/find, the type is already instantiated, so what's the point?

  • @mequint2000

    @mequint2000

    3 жыл бұрын

    @@user-cy1rm5vb7i I'm not sure I understand the question - what is the point of the iterator or the 'using' statement that syncs the iterator to its related template's contained class?

  • @peanutbutter8885
    @peanutbutter888510 ай бұрын

    I love it, I just have to watch it at 0.75x, my brother, you are talking super fast.

  • @coenfuse
    @coenfuse3 жыл бұрын

    Godbless KZread's playback speed option

  • @tamelo
    @tamelo3 жыл бұрын

    WHere is the source code? It is impossible to follow going up and down the page.

  • @omarshahin4881
    @omarshahin48813 жыл бұрын

    Would you put source file here please or any link to the source file, please?

  • @SpicyCurrey
    @SpicyCurrey3 жыл бұрын

    Nice

  • @himanshugupta7313
    @himanshugupta73133 жыл бұрын

    Does anybody has the source code for this? Reading the STL gives me a headache.

  • @foodsweets2728
    @foodsweets27283 жыл бұрын

    Playback Speed = 0.75, and you will understand every thing.

  • @milos5247
    @milos52473 жыл бұрын

    What is theme he is using for VS?

  • @embeddedbastler6406
    @embeddedbastler64063 жыл бұрын

    Coming from Rust, implementing Iterators is kind of the same thing, but in Rust it feels like a bit better integrated into the language.

  • @kunalmuley09
    @kunalmuley092 жыл бұрын

    11:55 How m_data pointer of Vector class is stored in Vector Iterator class

  • @RuthlessShinobi
    @RuthlessShinobi3 жыл бұрын

    the cherno

  • @rafalmichalski4893
    @rafalmichalski48933 жыл бұрын

    Finally bug with missing placement new fixed (I pointed it under Vector video).

  • @BiteSizeInfo.
    @BiteSizeInfo.7 ай бұрын

    Still learning c++11. it's like I am time traveling to past. 😂

  • @cmdlp4178
    @cmdlp41783 жыл бұрын

    Iterators do not nessesarily belong to containers. You can write iterators to implement infinite/lazy datastructures. The simplest example I came up with is the numeric range, like pythons range: struct NumberIterator { int i; NumberIterator& operator++() { ++i; return *this; } constexpr int operator*() const { return i; } constexpr bool operator!=(NumberIterator const& other) { return i != other.i; } }; struct Range { int a, b; constexpr NumberIterator begin() const { return {a}; } constexpr NumberIterator end() const { return {b}; } }; int main() { for(int i : Range{1, 6}) { std::cout

  • @blank-vw2sb
    @blank-vw2sb2 жыл бұрын

    2:02 "keyboard exercises"

  • @01001000010101000100
    @01001000010101000100 Жыл бұрын

    Finally, I've done iterator over my custom collection of indexable history items. As I couldn't use the pointer alone, because it wouldn't work with my collection ordering, I used the iterator that gets the index in constructor. Works as charm, it iterates from most recently added items, can also be reused with different indexable collections. Is there a neat syntax to use the same iterator to iterate backwards in C++17?

  • @Sami-df7dj
    @Sami-df7dj3 жыл бұрын

    For the second channel could you react to the 13 min Black myth: Wukong. The game looks very advanced. It’s like next gen of next gen. I think other people may be wanting to see this game as well in the perspective of someone like you. I don’t mind if you don’t do it though I will still love you content.

  • @luandkg
    @luandkg3 жыл бұрын

    Great 😙😙😙😙😙

  • @AnalogDude_
    @AnalogDude_3 жыл бұрын

    grrrr, can you use a pastebin and paste the code in there, place the link in the discription, i can't follow you and type it over, you're going to fast up & down. Qt Creator has the GNU ISO C++ Library.

  • @user-ol2hz5vn3i
    @user-ol2hz5vn3iАй бұрын

    this video's not getting captions 😂,well i'll take it as an exercise

  • @AnalogDude_
    @AnalogDude_3 жыл бұрын

    most compilers want: for(unsigned long i = 0; i < values.size(); i++)

  • @32gigs96

    @32gigs96

    3 жыл бұрын

    step aside noob. we gotta needlessly overcomplicate this for no reason. i want those compile times DOUBLED!

  • @RuthlessShinobi
    @RuthlessShinobi3 жыл бұрын

    the chern

  • @dc7538
    @dc75383 жыл бұрын

    Hi, is there any other way to open/find that vector class file, because I don't use visual studio, thanks in advance.

  • @user-cy1rm5vb7i

    @user-cy1rm5vb7i

    3 жыл бұрын

    your compiler typically has the std::lib headers in it's include directory somewhere in the compiler files, try searching there

  • @rodionsabbath9722
    @rodionsabbath97223 жыл бұрын

    Hey Cherno! What's your C++ book recommendation?

  • @gower1973
    @gower19733 жыл бұрын

    The command and conquer code base was released open source, maybe you could do a video series on it, walking us through it.

  • @bartoss92
    @bartoss923 жыл бұрын

    Well, I've watched this video without watching the "making vector class" video and that piece of Vector::ReAlloc function you showed here looks like some elvish magic :D

  • @AnalogDude_
    @AnalogDude_3 жыл бұрын

    that is Microsoft standard library

  • @catinwall4256
    @catinwall42563 жыл бұрын

    hi

  • @ataulfogomezgarcia5433
    @ataulfogomezgarcia54333 жыл бұрын

    Could someone please tell me which font and theme is he using? Thanks in advance.

  • @damnstupidoldidiot8776

    @damnstupidoldidiot8776

    3 жыл бұрын

    Probably consolas, and some dark theme.

  • @wazydotmeter
    @wazydotmeter3 жыл бұрын

    I have never seen that episode up their, Have you

  • @meyvy3792
    @meyvy37923 жыл бұрын

    great video,what the name of your theme thoXD

  • @gamingtech276
    @gamingtech2763 жыл бұрын

    Isn't the operator!= a bug? First you compare this.m_Ptr in the == overload member vars, then in the != you compare this with other? Isn't it more safe to always use a previously created method and just invert it (if invertable)? Such as you did with increment operators?

  • @ianpan0102

    @ianpan0102

    3 жыл бұрын

    He is exactly using the previously created operator== method to code the operator!=. The following two definition of operator!= will be equivalent, IF the operator== has been defined: 1.) m_Ptr != other.m_Ptr 2.) !(this == other)

  • @djllesh
    @djllesh3 жыл бұрын

    What theme is he using in Visual Studio? I want that so badly

  • @Mrcook777

    @Mrcook777

    3 жыл бұрын

    Hes using visual assist which is a paid add on for visual studio

  • @djllesh

    @djllesh

    3 жыл бұрын

    @@Mrcook777 I mean the code style. I know that it can be his own custom style, but maybe someone knows, where to get something simillar

  • @ronitech7802
    @ronitech78023 жыл бұрын

    Does C++ have any inbuilt mechanism to add iterator support to user defined structures?

  • @user-cy1rm5vb7i

    @user-cy1rm5vb7i

    3 жыл бұрын

    nope, and for a good reason. Iterators are designed to be a black box over indexing container's elements. And it's up to the user to provide one, which is more suitable for the use case

  • @cicciobombo7496
    @cicciobombo74963 жыл бұрын

    asking someone to read stl code is something i wouldn't wish to my worst enemy

  • @skyeplus
    @skyeplus3 жыл бұрын

    It's better to stick to naming conventions of STL/boost and use value_type, reference, pointer, etc., so your custom containers could interoperate with them.

  • @RoshanPradhan2
    @RoshanPradhan23 жыл бұрын

    Hey Cherno, can you recommend me a laptop under 100k rupees?

  • @focus9099
    @focus90993 жыл бұрын

    how long have you been doing this "hey what's up guys" with the hands? It's pretty cool :)

  • @Beatsbasteln
    @Beatsbasteln3 жыл бұрын

    can we please have a moment where we talk about how you did this thing where you changed a bunch of stuff from different lines of code at the same time in around 17:30-17:34? wtf, magic

  • @ilkeraktug6685

    @ilkeraktug6685

    3 жыл бұрын

    Visual Studio feature. Alt+Shift+ Up Arrow Key

  • @Beatsbasteln

    @Beatsbasteln

    3 жыл бұрын

    @@ilkeraktug6685 thx

  • @antonaparin
    @antonaparin2 жыл бұрын

    That's too hard to understand. Couldn't you do everything from scratch and not switch files so much?

  • @cgbbgc
    @cgbbgc3 жыл бұрын

    .

  • @aryanparekh9314
    @aryanparekh93143 жыл бұрын

    Helpful? The standard way to learn C++ is to read textbooks and watch The Cherno videos

  • @conflikt89
    @conflikt893 жыл бұрын

    jeez that intro really channeled peter mckinnon