From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-04-06 10:39:22
Because this block has undefined behavior
auto_ptr<T> p = new T[n];
because it calls
like it should, so we want to provide
auto_array_ptr<T> p = new T[n];
auto_ptr<T> p = new T[n];
----- Original Message -----
From: Amir Husain
Sent: Friday, April 06, 2001 7:04 AM
Subject: [boost] About auto_array_ptr
Must look like a kid question the thing i wanna ask is why do we use auto_array_ptr rather then the normal pointer wat benefits are
there in using it??
Why a auto_ary_ptr noa a normal ptr?
>From: "David Abrahams"
>Subject: Re: [boost] Re: auto_array_ptr
>Date: Fri, 6 Apr 2001 08:42:55 -0400
>Received: from [184.108.40.206] by hotmail.com (3.2) with ESMTP id MHotMailBC97046F005540043163D03263C68CF9139; Fri Apr 06 05:51:08
>Received: from [10.1.4.52] by hm.egroups.com with NNFMP; 06 Apr 2001 12:45:21 -0000
>Received: (EGP: mail-7_1_1); 6 Apr 2001 12:45:20 -0000
>Received: (qmail 5897 invoked from network); 6 Apr 2001 12:44:49 -0000
>Received: from unknown (10.1.10.26) by m8.onelist.org with QMQP; 6 Apr 2001 12:44:49 -0000
>Received: from unknown (HELO hwd.net) (220.127.116.11) by mta1 with SMTP; 6 Apr 2001 12:44:49 -0000
>Received: from davida [18.104.22.168] by hwd.net (SMTPD32-5.01) id ABB03F40256; Fri, 06 Apr 2001 04:50:56 PST
>From sentto-1234907-8052-986561121-amirhusain Fri Apr 06 05:53:00 2001
>References: <009d01c0be8f$a79478e0$160524d4_at_pdimov> <017601c0be92$74f59c90$6701a8c0_at_[hidden]>
>X-Mailer: Microsoft Outlook Express 5.50.4133.2400
>X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400
>X-eGroups-From: "David Abrahams"
>Mailing-List: list boost_at_[hidden]; contact boost-owner_at_[hidden]
>Delivered-To: mailing list boost_at_[hidden]
>----- Original Message -----
>From: "Peter Dimov"
> > The caveat about temporary smart pointer objects still applies. My rule is
> > "never create an unnamed temporary smart pointer." The non-const reference
> > idiom tries to enforce this rule... although I have another reason for
> > preferring pass by non-const reference:
> > void f(T arg);
> > T t;
> > f(t);
> > // now t is unchanged, right?
>Wrong, of course. Usually, the declaration of f isn't visible near the call,
>so you can't assume much about what's changed. But this case could be seen
>as an argument for using the unnamed temporary... then there's no object
>hanging around with a confusing value.
>To unsubscribe, send email to:
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk