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,147f221051e5a63d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!j22g2000hsf.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: memory management in Ada: tedious without GC? Date: Sun, 18 May 2008 07:21:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4ddef8bf-b5b1-4d7e-b75b-386cd6c8402c@l17g2000pri.googlegroups.com> NNTP-Posting-Host: 85.3.99.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1211120516 32178 127.0.0.1 (18 May 2008 14:21:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 18 May 2008 14:21:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j22g2000hsf.googlegroups.com; posting-host=85.3.99.233; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:204 Date: 2008-05-18T07:21:56-07:00 List-Id: On 18 Maj, 10:06, Simon Wright wrote: > Is auto_ptr the one where assignment moves the content? "b = a;" means > that a is now null and b references the previous content of a? Yes. > If so, it seems to me that it's the concept that's spectacularly > silly! It has its own very reasonable use case: safe returning dynamically allocated objects from functions. Outside of this single use case, you'd rather use scoped_ptr (maybe as unique_ptr) or shared_ptr. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com