🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13786

Re: std::auto_ptr<> Help Please

#13786
From: Harold Howe [TeamB]
Date: Fri, 12 Sep 2003 21:46
12 lines
1716 bytes
>> If so, this is much preferred over having to remember to delete the
>> object in the class' destructor.
> 
> I would say yes. See Herb Sutter's Exception C++ and More Exceptional C++.

But beware of incomplete types. In general, you can't have an auto_ptr 
member of a class if the pointer it is holding refers to an incomplete 
type (something that has been forward declared). Well, actually, you can 
use an auto_ptr here, but you have to be careful.

h^2
Technical Details
Message-ID: <3f623ea0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3F5E64B4.4050201@NetScape.net> <3F5E6A0C.6000601@anonymous_one.com> <3f5e7991$1@newsgroups.borland.com> <3f5eaa60$1@newsgroups.borland.com> <3f623db2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,da48c8ace4f19025
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-12 14:56:47 PST
Date: Fri, 12 Sep 2003 16:46:29 -0500
From: "Harold Howe [TeamB]" <hhowe@bcbdev.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: std::auto_ptr<> Help Please
References: <3F5E64B4.4050201@NetScape.net> <3F5E6A0C.6000601@anonymous_one.com> <3f5e7991$1@newsgroups.borland.com> <3f5eaa60$1@newsgroups.borland.com> <3f623db2$1@newsgroups.borland.com>
In-Reply-To: <3f623db2$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 66.43.209.135
Message-ID: <3f623ea0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063403168 66.43.209.135 (12 Sep 2003 14:46:08 -0700)
Lines: 13
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail