Raw pointers in application classes of C++ considered harmful
In order to achieve good reliability, clarity, scalability and re-usability of the application high-level programs written in C++ the pointers should not be used as class members (fields), because the raw pointers are too dangerous in this role and they do not represent meaningful relations between objects. Instead of raw pointers two smart pointers should be used. The first one describes exclusive unique ownership with synchronization of objects copying and deletion. The second one describes inclusive references to independent alien objects with invalidating the reference at the deletion of the addressed object. All power of object-oriented programming is preserved, but difficulties and errors are eliminated.
raw pointers smart pointers c plus methodology dynamic storage