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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool3.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> <1189502377.626510.172690@22g2000hsm.googlegroups.com> <5rjahxfvhazu.bol1ilmh6uew$.dlg@40tude.net> <1189537626.913207.116840@e34g2000pro.googlegroups.com> <1ww3fzbyqdqfo$.xogsd4dk2cg$.dlg@40tude.net> <1189600970.747079.309510@o80g2000hse.googlegroups.com> Date: Wed, 12 Sep 2007 17:25:17 +0200 Message-ID: <1u1t258vex8xy$.imjyh60opdsf.dlg@40tude.net> NNTP-Posting-Date: 12 Sep 2007 17:20:05 CEST NNTP-Posting-Host: 6e9ed692.newsspool1.arcor-online.net X-Trace: DXC=L=47L^mo3VD2:OR3:3gaE@ic==]BZ:afN4Fo<]lROoRA4nDHegD_]RE\l@X6GSkgBg\m5b78AaaH X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:1912 Date: 2007-09-12T17:20:05+02:00 List-Id: On Wed, 12 Sep 2007 05:42:50 -0700, Maciej Sobczak wrote: > On 12 Wrz, 11:32, "Dmitry A. Kazakov" > wrote: > >> And establishing connection upon >> construction is a bad idea anyway. > > Why? Because it takes time and it can be lost. >> class Foo >> { >> Baz * A; >> Bar * B; > > The biggest problem of C++ is not that it's crap, but that most people > were not exposed to correct idioms. > > Try this: > > scoped_ptr A; > scoped_ptr B; > > There are other smart pointers, depending on the need. Huh, that is exactly my point. Don't use plain pointers. A factory used instead of new T could do the work better. As I said, composition of constructors is a right thing. It is good that C++ does this (though not always incorrectly). It is bad that Ada does not. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de