On 6/9/2013 5:46 AM, Jochen Kunz wrote:
On Fri, 07 Jun 2013 19:50:58 -0400
Toby Thain <toby at telegraphics.com.au> wrote:
[C++]
apparently gained
some form of closure recently but it remains unclear how a lexical
closure is reliably implemented without proper gc
Well. As allways with C++: It
leaves the decision up to the programmer.
This way the programmer can, well should, must, choose what way that is
most efficient for the given situation. You can "plug in" a full blowen
garbage collector to manage your memory.
Is this actually an option? I'll admit it's been a few years since I
last investigated this but my understanding is that C++ garbage
collectors are all extremely limited in their ability to actually work
with real-world code. Especially if you commit the sin of calling other
code that isn't GC aware (i.e. all of it) or use pointers in interesting
ways, etc. Has this changed?
I think the "deliberate choice of many ways" you mention C++ giving you
basically boils down to either using ref counting (hopefully via RAII)
or nothing at all.
- Josh