The question is simple: I need that I could, using one pointer, change the data addresses of all its copies (well, for example, shared_ptr ). What is it for? Well, for example, there is a function that returns a pointer. But then I move the memory in a heap, and I want the pointer returned by me to have variability for just such a case and be able to remain valid after the shift. Is it possible to do this by standard means, and are such things practiced at all?

  • 3
    What does it mean to "move memory in a heap" ? - VTT
  • I personally did not understand anything. but I would like to understand - AR Hovsepyan
  • one
    Make a pointer to a pointer and change to health - int3

1 answer 1

Indeed, the output is simple: store a pointer to a pointer, in my case I used std::shared_ptr <std::unique_ptr <Type>>