Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pec017/smart_pointer-cpp

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Pointer of String

  • Templates
  • Inheritance
  • Reference Counting
  • Smart Pointers

UCObject

  • UCObject holds the count
    • use-counted object

UCPointer

  • UCPointer is a smart pointer to a UCObject
    • Using a template
    • Overloads -> and *

Relationship

  • String has a UCPointer
  • UCPointer has a StringRep
  • StringRep is a UCObject(inheritance)

Critique

  • 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

About

implementation by string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.