When creating shared_ptr, the manager object uses strong and weak reference counters. I understand that using a strong reference counter, shared_ptr knows when to free a managed entity, but I donβt understand why it uses a weak reference counter.
There are two objects associated with shared_ptr<T>and weak_ptr<T>:
shared_ptr<T>
weak_ptr<T>
T
, 0. , , .. , 0.
0
.
, . 0, , , . .
, .
, . , , , .
weak_ptr , , , . , - , , .
weak_ptr
Source: https://habr.com/ru/post/1548662/More articles:how to catch tomcat closing event? - javaRubymine debugger stopped breaking my breakpoints - debuggingASP.NET MVC cannot transfer files - c #Nodemon watch option broken - javascriptThe API stops working until the request is made on the GoDaddy server - c #TeamCity FxCop Choosing the Minimum RecommendedRules.ruleset Does Not Affect - fxcopReturning a path dependent type from a pattern match - scalaA process running on SQL Server 2008 R2 with spid = -2 - c #Task Status Pending Activation - c #Gradle Project Update Error (AS 0.8.2, Mac) - androidAll Articles