Subject: Re: [OT] Re: C++ *for Git*

From: David Kastrup <[email-masked]>
Date: Sun, 23 Sep 2007 23:31:20 +0200

Dmitry Potapov <[email-masked]> writes:

> On Sun, Sep 23, 2007 at 09:54:10AM -0700, Linus Torvalds wrote:
>
>>  - the stuff C++ *does* have is usually nasty. Implicit
>>  initializers and destructors and the magic lifetime rules of
>>  objects etc
>
> I am not sure what is wrong with initializers and destructors in
> C++, but certainly there is no magic lifetime rules in C++, as it is
> fully determined by the scope.

It has been some time since I last looked, but the lifetime of objects
constructed in return statements was a moving target through several
standards.  The last standard I bothered looking at had the object
survive until the statement with the function call expression ended:
quite a strange synchronization point with regard to language design.

> In fact, other high level languages that use GC have much more
> unpredictable lifetime rules for objects.

Mostly objects are alive as long as you can refer to them.  Not really
complicated.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum