Šimon Tóth’s Post

View profile for Šimon Tóth

C++ Educational Content Creator | 20 years of Software Engineering experience distilled into digestible daily posts

When working with objects managed by std::shared_ptr, we might need to give out access to the shared ownership of this object (e.g. when working with callbacks) without access to a std::shared_ptr that holds the ownership. The std::enable_shared_from_this mixin provides the method shared_from_this(), which returns a std::shared_ptr with access to the shared ownership. Compiler Explorer link: https://lnkd.in/e9Rz-uYq #cpp #cplusplus #coding #programming #dailybiteofcpp

  • text

To view or add a comment, sign in

Explore content categories