help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About %destructor is c++ mode


From: Hans Åberg
Subject: Re: About %destructor is c++ mode
Date: Thu, 18 Aug 2016 22:39:31 +0200

> On 18 Aug 2016, at 21:07, Min Wang <address@hidden> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]