From -6786173967991100591
X-Google-Thread: f78e5,480a31feed3c6a1b
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: petebecker@acm.org (Pete Becker)
Newsgroups: comp.std.c++
Subject: Re: boost::shared_ptr revisited again
Date: Wed,  1 Jun 2005 19:29:48 GMT
Organization: Dinkumware, Ltd
Lines: 52
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <-66dnQudcIH7lAPfRVn-uw@rcn.net>
References: <4299DE64.40403@poczta.onet.pl> <3g55jqFajuhcU1@news.dfncis.de> <aelne.1085$wy1.159@newssvr13.news.prodigy.com> <27WdncUItv4RcwDfRVn-oQ@rcn.net> <iFmne.23525$J12.15663@newssvr14.news.prodigy.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1117654198 20731 158.152.254.254 (1 Jun 2005 19:29:58 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 1 Jun 2005 19:29:58 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-DMCA-Complaints-To: abuse@rcn.net
X-Accept-Language: en-us, en
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j51JTmAS026150;
	Thu, 2 Jun 2005 05:29:48 +1000 (EST)
X-NNTP-Posting-Date: Wed, 01 Jun 2005 14:15:50 -0500
X-TN-Interface: 209.99.127.20
X-Delivered-To: std-c++@ucar.edu
X-Postfilter: 1.3.31
X-Authentication-Warning: serv3.gc.dca.giganews.com: news set sender to poster@giganews.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:4949

John Nagle wrote:
> Pete Becker wrote:
> 
>> John Nagle wrote:
>>
>>>
>>>    Well, yes.  After a decade of failure, it's clear that
>>> reference counted pointers cannot be implemented safely in
>>> C++ via the template mechanism.  The sordid history of
>>> auto_ptr, which, after three major revisions, still has
>>> holes, demonstrates this.
>>
>>
>>
>> std::auto_ptr is not a reference counted pointer.
> 
> 
>    I didn't say that it was.

I didn't say that you did. Readers of this thread can judge for 
themselves what the implication of your words is.

> But it has most of the
> same problems.
> 
>    The basic problem is "how do you prevent any reference
> to an object from outliving the object"?  Unless you have
> some reliable means of preventing that, the safety problems
> associated with "smart pointers" and auto_ptr remain.

Well, yes, whatever problems arise from having access to raw pointers 
are present if smart pointers give you access to raw pointers. It's 
certainly fashionable these days to label this "unsafe", but that 
doesn't make it hazardous.

One of the wonderful things about C++, though, is its extensibility. If 
auto_ptr and shared_ptr don't meet your needs, write your own smart 
pointer, use it, and get others to use it. Then propose it for the 
standard. If opposition is too strong, then maybe your assumptions are 
wrong.

-- 

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



