I'm so glad you made a video on smart pointers I really needed that and the explanation was really convincing. If possible kindly make a series on advance concepts of C++ which include all these topics like move, move copy constructor, rvalue , lvalue and all. Thanks for the video ♥️
Loved the way how the need was created and how it was explored to get done with these important concepts Di, would be better if the title is aligned also with concepts you and bhaiyya have taught in video!
it seems like you people have explained the same whatever has already written for unique smart pointer right.I appriciate your effort but you can explain the usage of smart pointer, I think you got it now
I have query, How move() Called function overloading defined in your uniqueptr class , when you said this function recieves ptr1 as && but how? should not we use ptr1.move() like ptr.reset()? so that it should call user defined move not std::move(). While explaining ->operator , you mentioned we dont have any function but we are using reset as function only ptr1.reset(), if we need to call it as ptr1->reset(), can we do it? one more , how to decide return *res or res and return type would be & or *? Any reference to understand this ..is can explain with diagram would be really helpful. Please prepare video for rvale and lvalue in detail. Thanks alot
Actually there is a problem and the problem is this in original unique pointer we can create a unique pointer which points to the array and in your implementation this will be error can you tell me how I can implement this ?
Hey, we have many students from all over the world - the site should be accessible. Can you please try again? If facing issues, please reach out to us at support@educosys.com . We will get it sorted asap. Thanks!
@@KeertiPurswaniIt was a typo, instead of courses i was writing course. Now i landed educosys site which i had already visited after watching your another video. Definitely i will purchase LLD, HLD and System design Course. Your way of explaining is awesome.kudos.
Hi how to delete if we alocate array dyanamic memory Like uniqueptr ptr(new int[10]); Need to handle both single memory o heap and array of memory in heap using delete and delete[] functions
@@shriramwarrior8936 we seen that DSA and oop is fine in c++ by all of us and lot of big folks also who working in big product based companies are code in c++ in their coding interviews but the problem is when u enter that company u will assign to backend majorly springboot means Java again those folks need to work in Java that's i need to convey am not degrading any language I love c++ than Java , telling about situation 🙏
Correction RAII stands for "Resource Acquisition is Initialization" not "in". Its a misnomer and IMHO a terrible name to a very powerful concept in C++
Hello guys, When I tried to perform the mimicing of UniquePtr, especially the move copy constructor, I encounter the following error. Any help to fix would be great. error: comparison between distinct pointer types ‘UniquePtr*’ and ‘int*’ lacks a cast [-fpermissive] 37 | if(this != &ptr) {
I didn't understand the memory leak thing... He deleted the variable 'a' after that 'a' stored in the stack got deleted but still remains in the heap. When he deleted the memory was reduced it came to 757 KB and he said no leak How did this process happen? I just saw memory got reduced...
Exact same question I've. 1. As per your explanation of memory leak, the value in heap memory lies there i.e the pointer variable 'a' pointing to the value stored in heap memory is still there that's why memory leak happens. 2. Deleting pointer variable 'a' stored in stack memory will delete that particular space in stack memory which is occupied by 'a'. 3. But value in heap memory to which a'' was pointing, didn't get deleted as per my understanding. @keertiPurswani : can you please explain?
A friendly advice from a developer(and a student too), your content is great but too much unnecessary meme clips in between that distract me a lot. When I am focusing on a particular line and understanding a concept, using my brain, carryminati comes on the screen and rotates his head 5 times, suddenly the line of code is gone and my chain of thoughts regarding the concept is just ruined in a second. Please understand that this is educational video not entertainment video. Thanks.
The return type does not include the template type T because the return type is not dependent on the template parameter T. The return type is simply a reference to the current uniquePtr object, regardless of the type of object it manages. Correct me if I'm wrong.