Those two operators are called "move constructor" and " move assignment operator". There are no such things as "move copy constructor" and "move copy assignment operator".
Hello Keerti I hope you are doing good and having productive week I have one query suppose I create a integer on Heap(int *p = new int(5)) and pass its address to sharedpointer (sharedpointer spr1(p) and create another sharedpointer(sharedpointer spr2(p)) and now suppose if spr1 goes out of scope before spr2 what will this result in?
Hey Keerti, Please bring more C++ Mock Interview videos. And please also cover topics from Basic C++ to Modern C++(At least till C++17)... POV : These videos may not have more views now but Mark My words, Your these types of videos will gain more views in long time. Please keep on giving such contents.. Please add more videos to C++ Playlist where you can talk about all Modern C++ thing and add Mock Interview of C++ there..! These will be very much Useful.. Thank You..!
Well for everyone’s awareness… shared pointer to mutable object is as good as mutable globals. So as general guideline avoid shared pointers as much as you can.
@@KeertiPurswani please recommend some projects I can work on to improve my c++ skills i.e. shared pointers... I have only worked with c++ stl so far for cp
@@coder7078 make Some game development projects.. you will love using shared pointers,as you have to be very careful with memory allocated for your game objects
Ref count should be atomic. Shared_ptr is only useful in multithreaded environment. You would just use a unique_ptr otherwise.
wrong
25:11 -> here we should wrap the logic of move constructor by if(this != ptr) because what if the user trying to self move(like moving ptr1 to ptr1)
No where on the internet you will find such content. Pure gold.
Thank you soo much guys this is been really really awesome to learn
Very good explanation of counter Amit ! Keep up the good work.
Very well explained :) , To my knowledge there is no need for nullptr check before deleting, delete internally checks it.
i dont think delete checks for nullptr
@@abhinavjha1973 deleting null pointer has no effect, you can correct me if I am wrong :)
Those two operators are called "move constructor" and " move assignment operator". There are no such things as "move copy constructor" and "move copy assignment operator".
Hello Keerti
I hope you are doing good and having productive week
I have one query
suppose I create a integer on Heap(int *p = new int(5)) and pass its address to sharedpointer (sharedpointer spr1(p)
and create another sharedpointer(sharedpointer spr2(p))
and now suppose if spr1 goes out of scope before spr2 what will this result in?
This type of video series are amazing, got to learn a lot
Great explanation
Hey Keerti, Please bring more C++ Mock Interview videos. And please also cover topics from Basic C++ to Modern C++(At least till C++17)...
POV : These videos may not have more views now but Mark My words, Your these types of videos will gain more views in long time. Please keep on giving such contents..
Please add more videos to C++ Playlist where you can talk about all Modern C++ thing and add Mock Interview of C++ there..! These will be very much Useful..
Thank You..!
++
great video, please do weak pointer implementation video next.
Well for everyone’s awareness… shared pointer to mutable object is as good as mutable globals. So as general guideline avoid shared pointers as much as you can.
Cool! more c++ please and a better mic too.
In copy assignment, is there a memory leak when you are doing res=ptr_res. how will we delete the memory previously pointed by res.
decrement_counter() function handles that
Best Understanding
where is this even used ??
If you are a C++ developer, it is one of the most important concepts - in daily work as well as in interviews!
@@KeertiPurswani please recommend some projects I can work on to improve my c++ skills i.e. shared pointers...
I have only worked with c++ stl so far for cp
@@coder7078 make Some game development projects.. you will love using shared pointers,as you have to be very careful with memory allocated for your game objects
Ma'am pls can you share information about opportunities for c++ developers in IT field.
Because I rarely see any companies hiring for c++ developers.
All automotive industry use c++, c++ developers are less and more demanding in automotive industry
Hi ma'am same video on Java will be appreciated 💯☝️
mam send link of part 1 video
👌 cool
wah sab jante hue bhi kya samjhne ki acting ki hai😀
Ex-boyfriend😂😂😂. grt jok