Single video explaining rule of 3, deep/shallow copy, why we need to delete heap objects created by the class in it's destructor, also possibly hinting where smart pointers could help This is a brilliant example.
Thanks for an excellent video! The visuals are helpful and reinforce what you are talking about. You stay strictly on topic, and cover the material at a comfortable pace. Great stuff!
Can you do an extension video to this for the MOVE CONSTRUCTOR and the MOVE ASSIGNMENT OPERATOR? This video really helped me out but now we've added these extras as the Rule of 5.
Awesome video...understood obscure concepts like shallow copy , deep copy , copy constructor and assignment operators. also when to use them..very worth video.expecting more such videos on complicated concepts in C++.Thanks.
I have a vector of vector of struct. The struct has pointers. I want to make operator= do a deep copy. But the operator= isn't getting called when i do: vecVecStruct1 = vecVecStruct2; Any idea why? Is this supposed to work?
what if we create a class called Tools and we define a copy constructor and operator there and then create a Tools object inside Character. Do we need to define the copy constructor and operator for Character in this case? Also, what if I've got a pointer as a reference (I'd store it as & but then I'd need to set it in a ctor and I want to set it in a function not the ctor, so it ended up being the pointer)? I do not delete this pointer, because it is handled somewhere else I do not use new on it, just as the reference. Do I still need the copy ctor and operator?
Operator overloading would apply to the class level. It simply deep copies an entire object. This is different to pointing different pointers to a specific class. You can still assign the value of one pointer to another and still implement operator overloading. The two shouldnt really influence each other
I have a vector of vector of struct. The struct has pointers. I want to make operator= do a deep copy. But the operator= isn't getting called when i do: vecVecStruct1 = vecVecStruct2; Any idea why? Is this supposed to work?
OMG you explain better than my college professors!
ya jesus
Wowow
Most college profs suck big time at explaining so that doesn’t say much
this is exactly why I'm here. My prof is... not great at explaining this
You chose an excellent example to explain this concept.
Six years after publishing, but still relevant and an excellent overview. Thank you!!!
7 years now and is still the best explination I found on UA-cam
@@paula19335 8 years and still good
@@jensmalzer6344 9 years and still good
@@rahulsarkar4530 10 years and still good
12
Single video explaining rule of 3, deep/shallow copy, why we need to delete heap objects created by the class in it's destructor, also possibly hinting where smart pointers could help
This is a brilliant example.
Fantastic! I struggled to understand this in a lecture today but this has been a big help. Thank you!
supreme analogy with role play characters.
Ive had 2 or 3 professors try to explain this concept and it never made any sense. This does. Thank you.
Had trouble understanding this in class but you made it very clear, thank you.
Thank you. I am preparing for my C++ final exam. It is really helpful.
Well explained!!
I have read about this topic in a book. This was incredibly more understandable! Thanks a lot, and best of luck
This was a god tier explanation! You've earned yourself a new subscriber!
Your teaching abilities are excellent !!
Awesome video, Thank you!
Very clear explanation of the reasons behind the 'rule of three' - thanks.
Subscribed, I am so glad that I found this channel
amazing explanation man spent a semester and didn't understand these watched one video of urs and piece of cake
Thanks for an excellent video! The visuals are helpful and reinforce what you are talking about. You stay strictly on topic, and cover the material at a comfortable pace. Great stuff!
amazing explanation. you’re a great teacher. thank you!
That's how you explain rule of three, perfection
Very nice video. You present a clear and succinct exposition of the concepts. Thanks!
Fabulously explained. I used to have much trouble with this.
Great video! Everything just made so much more sense now. Thank yoU!!
best explanation very good and easily understandable. thank you sir.
What a brilliant exploration!
This video was extremely helpful! Thank you!
D Y N A M I C A L L O C A T I O N baby
Awesome explanation, thank you!
This is an amazing explanation!
Very helpful.
Wow I ask myself why can't we get explanations like these in our educational institutions.
Thats the most perfect way a guy could have explained that
Are u alive it's been 8 years
Thank you. Very Clear Explaination.
Thanks for the video, really helped. Very well explained!
Superb, thanks for explaining so lucidly!
Awesome video dude, very understandable!
This is wonderful. Thank you very much
CLEAR, NICE, TO THE POINT.
thank you ReelLearning.
wow, this explanation is perfect!
Can you do an extension video to this for the MOVE CONSTRUCTOR and the MOVE ASSIGNMENT OPERATOR? This video really helped me out but now we've added these extras as the Rule of 5.
awesome video, super explanation.... i like it bro , thanks....
Thank you so much for these Tutorials!
Awesome video, the explanations are perfect!
Good to have this video in my life.
Thank you so much!! It's starting to make sense, but my brain still feels so fried :/ ugh okay just gonna do some more practice lol
This is great! Thank you!
Awesome video...understood obscure concepts like shallow copy , deep copy , copy constructor and assignment operators. also when to use them..very worth video.expecting more such videos on complicated concepts in C++.Thanks.
Oustanding Explanation. (period)
It's very clear! Thank you! What' s the link for next video! can't find it!!
I have a vector of vector of struct.
The struct has pointers.
I want to make operator= do a deep copy.
But the operator= isn't getting called when i do:
vecVecStruct1 = vecVecStruct2;
Any idea why? Is this supposed to work?
Everything was so clear. Thank you.
by depending on data members, you mean dynamic allocated variables?
Sir thanks for the video , you're awesome !
finally a nice tutorial with no indian accent
what if we create a class called Tools and we define a copy constructor and operator there and then create a Tools object inside Character. Do we need to define the copy constructor and operator for Character in this case? Also, what if I've got a pointer as a reference (I'd store it as & but then I'd need to set it in a ctor and I want to set it in a function not the ctor, so it ended up being the pointer)? I do not delete this pointer, because it is handled somewhere else I do not use new on it, just as the reference. Do I still need the copy ctor and operator?
Excellent
BLESS UP FOR THIS VIDEO
How to overload the obj "cout" using the operator "!=" ?
Nice Presentation, i wonder which tool have you used to make it. Please if anyone can tell
Last video 5 years ago? I hope all is well with you! Great vids
In this case you haven't used the 'new' keyword so Tool * toolArray is in the stack right ?
good one
Great video now I understand
Nicely done!
thanks man great video
Why not just not use a pointer?
really helpful
that was owesome man! thanx.
Grate whay to explain. You shoud work in education learning teachers/profesors how to explain programing rules ! GJ
Very helpful thanks!
Awesome!
i cant stand awful voices, not only yours is great but it was super well animated
Thank You !
nailed it !! tnx
Thank you. :)
I don't recommend overloading the = operator, if a user wants to copy the object pointer he should always be able to do it
Operator overloading would apply to the class level. It simply deep copies an entire object. This is different to pointing different pointers to a specific class. You can still assign the value of one pointer to another and still implement operator overloading. The two shouldnt really influence each other
thank you)*
best!
Plz update to old school runescape and Get nicer weapons lol
I specifically looked @ the comments to see if someone would mention osrs.
Bucky for sure
rule of 3 in c++: OCD
Real solution: use std::vector
I have a vector of vector of struct.
The struct has pointers.
I want to make operator= do a deep copy.
But the operator= isn't getting called when i do:
vecVecStruct1 = vecVecStruct2;
Any idea why? Is this supposed to work?