SmartPointer & Inheritance & Explicit Constructors

J

James Kanze

[ ... ]
It's still very much in a state of flux, but the last proposal I
saw provided for three cases: code which required garbage
collection, code which couldn't work with it, and code which was
garbage collection neutral. Presumably, the standard libraries,
and most third party libraries, would be designed to fall into
the last category. (Although I suspect that more than a few
implementations would offer two sets of libraries, one of which
required garbage collection, simply because something like
std::basic_string can be made a lot faster if you can count on
garbage collection being present.)
The most recent draft I've looked at on it is N2287. It fairly
specifically does NOT say you can ever depend on GC being present.

The text from the garbage collection proposals hasn't made
it into the draft yet, at least as far as I can see. For that
matter, I think that the current state of the proposal is far
from final.
I know a lot of people really want garbage collection, and I know some
smart people have really put some hard work into it -- but when you get
down to it, trying to specify GC in terms of externally visible,
required behavior is nearly impossible.

In the same way that trying to specify free() or the operator
delete() function is. (Both can be no-ops in a conforming
implementation, but of course, that is neither the intent, nor
what we expect from a QoI point of view.)
 
J

Jerry Coffin

[ ... ]
The text from the garbage collection proposals hasn't made
it into the draft yet, at least as far as I can see. For that
matter, I think that the current state of the proposal is far
from final.

Sorry -- I didn't mean the draft standard, but the draft garbage
collection proposal...
In the same way that trying to specify free() or the operator
delete() function is. (Both can be no-ops in a conforming
implementation, but of course, that is neither the intent, nor
what we expect from a QoI point of view.)

Right -- the difference being that the lack of definition of free/delete
has relatively little effect on the rest of the standard -- i.e. there's
a few lines devoted to describing what they're intended to do, and
that's it. In the case of GC, however, there's a _lot_ of text devoted
to definding things like what's collectible, what's unreachable, etc.,
-- but in the end, none of it really specifies any requirements.
 
J

Jon Harrop

Using a refcount smart pointer, can you show me an actual code example
of when a circular dependency is created? Yeah, I figure A->B and B->A,
but I'd appreciate if you could share actual code samples.

Symbolic manipulation, because expressions can refer to each other
arbitrarily. Mathematica is written in a dialect of C and uses reference
counting. Consequently, it leaks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top