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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6dcdd5b561500c28 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!v39g2000pro.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: smart pointer dangerous (no -> operator) Date: Fri, 16 Jan 2009 13:21:37 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <49707299$0$32667$9b4e6d93@newsspool2.arcor-online.net> NNTP-Posting-Host: 83.76.207.254 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1232140898 1938 127.0.0.1 (16 Jan 2009 21:21:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Jan 2009 21:21:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v39g2000pro.googlegroups.com; posting-host=83.76.207.254; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3399 Date: 2009-01-16T13:21:37-08:00 List-Id: On 16 Sty, 12:42, Georg Bauhaus wrote: > Frequently overlooked, I think, Ada has nested scopes, useful > in many ways here. [...] The problem is that in the majority of cases the whole point of creating something dynamically (rather than on the stack) is to use it in some other scope - outside of where it was created. In your example the only motivation for allocating the object dynamically would be to trade off stack space for heap space. Are there any others? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada