dimanche 10 octobre 2021

should the intelligent pointer be used in basic data structure, e.g. doubly linked list, binary tree?

For the basic data structures, for instance,
Doubly linked list has something like Node * next, Node * prev;
Binary Tree has something like Node * left, Node * right;
What are the pros. and cons. by using unique_ptr or shared_ptr to replace above Node *?
Are there any well-known open source projects in this way?

Aucun commentaire:

Enregistrer un commentaire