Re: [OT] Re: C++ *for Git*
- From
David Kastrup <dak@gnu.org>
- Date
- Sep 23, 2007, 21:31 UTC
- Message-ID
- <85ejgpkr13.fsf@lola.goethe.zz>
- In-Reply-To
- <20070923212239.GA7249@potapov>
Dmitry Potapov <dpotapov@nbs-eng.ru> writes:
Show 9 quoted lines
> 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