
"Peter Dimov" <pdimov@mmltd.net> writes:
Larry Evans wrote:
If you could "reflect" all the reference counted smart_ptrs, like shared_ptr, for a class, T, into some class specific structure, say gc_desc<T>, then you could use this for precise garbage collection, AFAICT. Although it does expose the guts (after all, shared_ptr<X>, might be private in T), this is what you'd need to detect cycles.
sp_collector.cpp finds shared_ptr instances with a memory scan. That's not the problem. The problem is following other owning pointers.
Or, in more general terms, the problem is that different reflection clients need different things to be reflected.
Sounds like what I've been saying in a different thread. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com