Re: Unified Pointer Library
Hello, ViTech, you wrote: S>> And what exactly you imply when speak: "for normal support of unique possession (composite aggregation) that integrity of communications" VT> Hardly above an example with Car, Engine and Monitor was observed. For example, I want, that Car is unique owned Engine, and Monitor could watch for Engine. How suggest it to do by standard pointers With ++ in the multi-threaded environment to avoid a problem with dangling pointers? Or and it is not necessary so to do this strange desire? The most simple method is to use std:: shared_ptr. Because joint possession of object Engine (both in Car, and in Monitor) is real at you. As Engine cannot be destroyed earlier, than both die is both Car and Monitor. More difficult - to provide time supervision of life Car any with other means. For example, it is explicit in the program to destroy at first Monitor, then Car.