Комментарии:
I'm actually slightly confused as to why we have the need to make these operators. Like it looks like we're just saying the same operation inside the struct method, like "position + speed" -> "coordinate + other.coordinate" - I don't see what it does differently to what was said. Also I'm not sure if I understand what we're doing, I was thinking we should multiply the speed by time to get the added position, unless our speed is actually in discreet chunks, i.e. normalized to constant time and making it directly a distance value. In any case they're two float numbers, why can't they be added without saying + means +? Because they have two values and the compiler doesn't understand what you want to add together, the x+y parameters in the position or x parameters between position and speed?
Now I actually think this is a fantastic way to extend my personal math program for school work with vector addition and multiplication, I was actually just last night pondering about how to go on about it when you have things like dot and cross products.
Taking my first programming class and this series has been really helpful. Thank you.
Ответитьi can't believe that this is free.
Ответитьthe fck cant understand a thing
ОтветитьWhy use this concept though, what is the real world application.
ОтветитьThank you this helped operator overloading click
ОтветитьI'd be interested in a video about move assignment, copy assignment, assign by reference operators.
ОтветитьMan, you are amazing, thank you a lot for your videos.
Ответитьprint to the conzuuuuuul
Ответить难点:cout << vector2(二维向量)
Ответитьyou are way to fast and not clear
ОтветитьWonderful explanation! Truly truly wonderful explanation of a pretty tricky concept to get your head around initially. Now it all makes sense.
ОтветитьI realize you know your "stuff" but your teaching style comes across more like you're trying to impress us with your skill, and you are, but less like you care if those of us not nearly on your level leave with anymore than when we clicked on your tutorial. Anyway, thanks for the effort but the way you fly through your demos makes me think I need to find a tutor who talks as slowly as I comprehend.
ОтветитьC++ gives you full control, which can kinda be a bad thing.
Yeah, like allowing someone to write 24 bytes of random data to address location 0 of every hard drive on the system. Every hard drive. No, I wasn't that guy, I was the guy that had to see why running the application resulted in rebuilding the system disk and data drives.
Why is cout << result 2 not working by default?😅I am pretty new to programming sry.
ОтветитьI can't seem to wrap my mind around how position "gets into" the add function. I understand they we're accessing add, and that add takes in speed, and that add returns a new Vector2, but I'm not understanding exactly how position "gets into" the function. Is this just one of those "that's how the code works" kind of things? I understand stuff like .length() returns a length, but this one is confusing
ОтветитьBro what?
Ответитьvery informative
thank you a lot
Hey, Cherno, I really enjoy your video.
I try to practice your technique. However, " return *this + other; " not work for me.
I compile it with gnu g++. Is there any thing I missed?
am I the only one who listens him in 0.75 speed
Ответитьnot string like ....thinking ... like me LOL
Ответитьwhile watching this video i understand this video isnt for begginers like me
:)
Operators are functions and they make code look better.
ОтветитьOnce you open a Cherno's video, first thing first, speed: 0.75.
ОтветитьI have to ask, what is the meaning when you write " :x(x), y(y) {} before the body of a function? is it a faster way to declare the variables?
Ответитьamazing
ОтветитьPersonal Notes:
- well understood
It was really an informative video.Thanks Cherno😀
Ответитьgahdamn bro I love you but you talked way too fast in these videos hahah
ОтветитьThis series is FABULOUS Cherno! You've clarified all of my doubts, thank u buddy =D
ОтветитьIf people need to go to the definition of your operator to understand what it does, you're probably not doing your job.
Great video, Cherno!
Cherno, thanks for these videos. After taking a year off of coding after school to pursue something else, reviewing these topics from a real-world use-case standpoint makes them make a lot more sense as to what they are useful for compared to how we learned them in school. Yes, we learned them well in school, but it was rarely made clear as to what the expected usage of each topic should be. I now have a better understanding of when I should overload operators!
ОтветитьIf it helps from a python view, think of these operator overloading methods as deprecated methods from python (such as def _str_ and def __add__).
ОтветитьFor equal operator, do we need to define an errorThreshold epislon and compare two Vector difference with that epislon? Otherwise, the comparison result may be inaccurate.
Ответить"What are you doing" stares hard LOL😆
ОтветитьI think you can beat eminem in rap
Ответитьcan someone explain how he navigates through his code so fast? he selects, copies and pastes code so fast?
ОтветитьSometimes. you just go through so much information and you understand it but you don't really understand it. Then sometimes, you stop to think and apply what you just learnt and you really understand the concept and you feel like your brain just expanded a little. This is happening too frequently since I have started watching this series.
Ответитьi thought we have operator overloading in java too?
ОтветитьLove u!
ОтветитьCould someone help me with this question? After overloading, what is the order of the Arithmetic Operatoration. Does "*" still have higher priority than "+"? and Why?
ОтветитьLearning this in my CS class kinda made me die inside. I was able to understand you much more easily, thank you!
ОтветитьCan you ID an IDE that would highlight overloaded operators, such as color coding. It does make easier to read the code.
ОтветитьI'm pretty late to the party here, but can someone explain to me what does "doesn't modify the class" mean? What is a case in which a function would modify the class it belongs to?
Ответить