-
.
, ,
. " " -
ChainDescriptor, . (
Node Node
ChainDescriptor.) ,
, ;
, .
, , , .
, std::shared_ptr , 1) Node
"" a ChainDescriptor,
Node, 2) , ,
DAG (, ,
). ,
, shared_ptr
. ,
ChainDescriptor shared_ptr.
(FWIW: I used a reference count for nodes in a parse tree that I wrote many years ago, and different instances can share subtrees. But I developed it from start using reference counted pointers. And because of how the tree was built I was sure that there could be cycles.)
source
share