Tag: Cyclic
C++11 Smart Pointer – Part 5: shared_ptr, Binary trees and the problem of Cyclic References
Main advantage of shared_ptr is that it automatically releases the associated memory when not used any more. But if we don’t use shared_ptr carefully then this advantage can turn into a disadvantage. Let’s look how, Advertisements Suppose I have to design a binary tree and in it the node contains a pointer to left and …