Shared Pointers Implementation-MUST know! Advanced C++ Topics for Interviews!

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 33

  • @henryallenlaudemilk5161
    @henryallenlaudemilk5161 Před 11 měsíci +2

    Ref count should be atomic. Shared_ptr is only useful in multithreaded environment. You would just use a unique_ptr otherwise.

  • @ishankbansal9239
    @ishankbansal9239 Před 24 dny

    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)

  • @abhisharma7780
    @abhisharma7780 Před 11 měsíci

    No where on the internet you will find such content. Pure gold.

  • @amoghpujar28
    @amoghpujar28 Před 7 měsíci

    Thank you soo much guys this is been really really awesome to learn

  • @philosophers_wool
    @philosophers_wool Před 9 měsíci

    Very good explanation of counter Amit ! Keep up the good work.

  • @nandishnan5680
    @nandishnan5680 Před rokem +1

    Very well explained :) , To my knowledge there is no need for nullptr check before deleting, delete internally checks it.

    • @abhinavjha1973
      @abhinavjha1973 Před 3 měsíci

      i dont think delete checks for nullptr

    • @nandishnan5680
      @nandishnan5680 Před 3 měsíci

      @@abhinavjha1973 deleting null pointer has no effect, you can correct me if I am wrong :)

  • @kocho4242
    @kocho4242 Před 2 měsíci

    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".

  • @rohitahuja2782
    @rohitahuja2782 Před 8 měsíci

    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?

  • @palashyadav668
    @palashyadav668 Před rokem

    This type of video series are amazing, got to learn a lot

  • @dipakingle6629
    @dipakingle6629 Před měsícem

    Great explanation

  • @KumarBharat85
    @KumarBharat85 Před rokem +2

    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..!

  • @FireHarmony-dl2bk
    @FireHarmony-dl2bk Před 9 měsíci

    great video, please do weak pointer implementation video next.

  • @RishabhRD
    @RishabhRD Před rokem

    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.

  • @art4eigen93
    @art4eigen93 Před rokem

    Cool! more c++ please and a better mic too.

  • @sakshamgupta3499
    @sakshamgupta3499 Před 10 měsíci +1

    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.

  • @souravsarkar6107
    @souravsarkar6107 Před rokem

    Best Understanding

  • @coder7078
    @coder7078 Před rokem +2

    where is this even used ??

    • @KeertiPurswani
      @KeertiPurswani  Před rokem +1

      If you are a C++ developer, it is one of the most important concepts - in daily work as well as in interviews!

    • @coder7078
      @coder7078 Před rokem

      @@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

    • @monty6393
      @monty6393 Před rokem

      @@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

  • @rtadwq...------...----.
    @rtadwq...------...----. Před 9 měsíci

    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.

    • @AshaRASHA-sv7nq
      @AshaRASHA-sv7nq Před 2 měsíci

      All automotive industry use c++, c++ developers are less and more demanding in automotive industry

  • @poorpanda9033
    @poorpanda9033 Před rokem

    Hi ma'am same video on Java will be appreciated 💯☝️

  • @we_atheletes
    @we_atheletes Před rokem

    mam send link of part 1 video

  • @rahulrajput-ec1to
    @rahulrajput-ec1to Před rokem

    👌 cool

  • @Cosmic_Horizons
    @Cosmic_Horizons Před 5 měsíci

    wah sab jante hue bhi kya samjhne ki acting ki hai😀

  • @satishm5260
    @satishm5260 Před 10 měsíci

    Ex-boyfriend😂😂😂. grt jok