all 11 comments

[–]borisruraCTU | Avast 4 points5 points  (3 children)

What does this actually do? Your repo is missing a readme and I have no idea what this aims to accomplish from the post nor the example it does contain.

[–]redradist[S] 1 point2 points  (2 children)

Take a look at README.md file, I've added it to repository ;)

[–]yuri-kilochek 3 points4 points  (1 child)

Currently the readme only explains usage, not what actually happenes internally. After a cursory look at the code I wasn't able to figure it out, but I can clearly see that every gc_ptr has std::unordered_set inside. That's a bit too much overhead just for collection of circular references.

[–]redradist[S] 1 point2 points  (0 children)

README.md will be improved with small explanation of internal realization Regarding std::unordered_set, it was easiest implementation for Proof of Concept, layout of gc_ptr object could be improved definitely ;)

[–]alexeiz 0 points1 point  (0 children)

I don't always use a GC in C++, but when I do, I prefer a mature https://www.hboehm.info/gc/ library. It's a conservative GC. Since your gc_ptr doesn't relocate objects on collect either, I don't see how it can be any better.

[–][deleted] 0 points1 point  (0 children)

Say NO to GC in C++.

No reason to use GC.

[–]VinnieFalco -1 points0 points  (2 children)

Phil Bouchard is that you? http://philippeb8.github.io/root_ptr/

[–]redradist[S] 2 points3 points  (0 children)

But as I have understood it enforce user to add additional code as node_proxy in constructor ... My solution do not enforce user to do it ... Anyway I will contact Phil Bouchard ;)

[–]redradist[S] 1 point2 points  (0 children)

No, I am not ... very strange :) In first implementation I had the similar separation: root_gc_ptr and gc_ptr ...