> On 18 Aug 2016, at 21:07, Min Wang <[email protected]> wrote:

> Could you explain more on  "reference count” ?

One adds an integer variable for each object, keeping track how many other 
objects referencing it, cf. [1]. Might be used in a runtime environment where 
one cannot risk hitting GC time, but is tricky to implement by hand, and one 
limitation is that circular reference are not removed.

The programming language Swift has that builtin [2-3].

> do you mean std::shared_ptr?

Yes, this class of C++11 and later provides it, so you might try it, cf. [4].


1. https://en.wikipedia.org/wiki/Reference_counting
2. https://en.wikipedia.org/wiki/Swift_(programming_language)
3. 
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/AutomaticReferenceCounting.html
4. https://en.wikipedia.org/wiki/Smart_pointer#shared_ptr_and_weak_ptr




_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to