Article View: comp.std.c++
Article #3314Re: proposal: renew & relocator member fn
From: john (j.d.) hickin
Date: Sat, 10 Feb 1996 08:35
Date: Sat, 10 Feb 1996 08:35
23 lines
1633 bytes
1633 bytes
|> Go ahead, shoot me down! POW! Seriously, how can the compiler tell when deep-copy is or isn't needed. You can help it, however, by using auto_ptr for the 'external' parts of an object (i.e., those logically part of it but included through a pointer; this term is my own so don't expect others to use it; I am looking for a better term). With auto_ptr's in place your relocate operation is a breeze -- just copy the object with a copy constructor and placement new. This seems to be an ideal application for certain semantics of auto_ptr that have been considered to be offensive. To be maximally const-correct your class will need a non-const copy constructor. -- John Hickin Nortel Technology, Montreal, Quebec (514) 765-7924 hickin@bnr.ca --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. Moderation policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID:
<4ffq10$7vb@bmtlh10.bnr.ca>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<GNB.96Feb7140952@dame.bby.com.au>Show Full Headers
Complete Article Headers
From: "john (j.d.) hickin" <hickin@bnr.ca> Message-ID: <4ffq10$7vb@bmtlh10.bnr.ca> X-Original-Date: Fri, 9 Feb 1996 15:42:24 +0000 Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 10 Feb 96 08:35:39 GMT Approved: fjh@cs.mu.oz.au Return-Path: <daemon@meeker.UCAR.EDU> References: <GNB.96Feb7140952@dame.bby.com.au> Subject: Re: proposal: renew & relocator member fn Newsgroups: comp.std.c++ Organization: Bell-Northern Research X-Mailer: Mozilla 1.1 (X11; I; HP-UX A.09.05 9000/715) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMRxZIOEDnX0m9pzZAQG+LwF/S3HU0BrOOOhBNEQINW1P+bwKAafP2Tzs gOIjXZkM6oSJsKS63+3KhvfOKYqZUScR =++JQ