[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
- Re: About %destructor is c++ mode, (continued)
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/18
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/18
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/18
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/18
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode,
Hans Åberg <=
- Re: About %destructor is c++ mode, Min Wang, 2016/08/18
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/19
- Re: About %destructor is c++ mode, Min Wang, 2016/08/19
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/19
- Re: About %destructor is c++ mode, Min Wang, 2016/08/19
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/19
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/19
- Re: About %destructor is c++ mode, Min Wang, 2016/08/19
- Re: About %destructor is c++ mode, Hans Åberg, 2016/08/19
- Re: About %destructor is c++ mode, Min Wang, 2016/08/19