[MECpp]Item-29 Reference Counting
· β 17 min read
Reference counting is technique that allows multiple objects with the same value to share a sinple representation of that value.
Reference counting is technique that allows multiple objects with the same value to share a sinple representation of that value.
Smart pointers are designed to look, act, and feel like built-in pointers, but to offer greater functionality.
Combining object-counting technique with the pseudo-constructors, we can limit the number of objects of a class.
Depending on the different input or dynamic types of function parameters, “virtualization” is a useful technique to construct new objects of different types accordingly, or to conceive of non-member functions whose behavior changes accordingly.