Skip to main content

2 docs tagged with "reference-counting"

View all tags

std::shared_ptr

Smart pointer with shared ownership via reference counting. Multiple shared_ptrs can own the same object, deleted when last owner destroyed.

std::weak_ptr

Non-owning observer of shared_ptr-managed objects. Doesn't increase reference count, enables checking if object still exists.