From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6b1a1ed8b075945 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Allocators and exceptions Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1189323618.588340.87180@o80g2000hse.googlegroups.com> <1189369871.672082.162750@50g2000hsm.googlegroups.com> <1189460936.295604.143720@r29g2000hsg.googlegroups.com> Date: Tue, 11 Sep 2007 11:16:31 +0200 Message-ID: NNTP-Posting-Date: 11 Sep 2007 11:11:20 CEST NNTP-Posting-Host: 0f0c2f61.newsspool2.arcor-online.net X-Trace: DXC=]_9?bcij5S5T2Rfi67enW;^6ZC`4IXm65S@:3>?dUP\DgTLlU; X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:1882 Date: 2007-09-11T11:11:20+02:00 List-Id: On Mon, 10 Sep 2007 14:48:56 -0700, Maciej Sobczak wrote: > On 10 Wrz, 14:42, "Dmitry A. Kazakov" > wrote: > >>> P.S. Exceptions in constructors is a bad idea. > > No, it's a very good idea. Otherwise you have to deal with half-baked > objects, which is Even Bigger Mess (tm). This is what you get when the exception is propagated out of a constructor. It breaks the abstraction, necessarily. You cannot handle this unless you accept the idea that one can always view an object as an aggregate of other objects. This in turn would imply 1) types matched by structure, 2) broken encapsulation. You want the compiler to invent partial constructors/destructors, it is a difficult problem, probably undecidable. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de