- Templates
- Inheritance
- Reference Counting
- Smart Pointers
- UCObject holds the count
- use-counted object
- UCPointer is a smart pointer to a UCObject
- Using a template
- Overloads -> and *
- String has a UCPointer
- UCPointer has a StringRep
- StringRep is a UCObject(inheritance)
- UCPointer maintains reference counts
- UCObject hides the details of the count String is very clean
- StringRep deals only with string storage and manipulation
- UCObject and UCPointer are reusable
- Objects with cycles of UCPointer will never be deleted