weak_ptr

std::weak_ptr

std::unique_ptr models the concept of exclusive ownership, std::shared_ptr the concept of shared ownership. If I stick to this picture then std::weak_ptr models the concept of temporary ownership because it borrows the resource from a std::shared_ptr. There is one dominant reason for having a std::weak_ptr in C++: breaking of cyclic references of std::shared_ptr's.

Read more
Comments 5Views: 13643

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 231

All 1247919

Currently are 180 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments