From 8755928284226131119
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,4441c5f6d7843223
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-03 10:49:13 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: steve@steveheller.com (Steve Heller)
Newsgroups: comp.std.c++
Subject: Re: C++0x Wish List (explicit class)
Date: Tue, 3 Sep 2002 17:49:13 +0000 (UTC)
Organization: Giganews.Com - Premium News Outsourcing
Lines: 44
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <b7j9nuo4dg9916bbtv6o1rrvvn5gr3f0cp@4ax.com>
References: <3D48C729.40503@spamnot.codeweavers.com> <ehdlkuo9gkcu69b6og2aup9o63knu7tpra@4ax.com> <8c8b368d.0208060921.43e9e9d5@posting.google.com> <3D5086C0.664A29E9@bawi.org> <8c8b368d.0208071131.5306ddd2@posting.google.com> <23b84d65.0208081146.169d3d83@posting.google.com> <d6651fb6.0208090619.20268d56@posting.google.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1031075353 1619 10.0.0.1 (3 Sep 2002 17:49:13 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 3 Sep 2002 17:49:13 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 17mHnb-0000Py-00
	for mail2news@news.news.demon.net; Tue, 03 Sep 2002 17:49:11 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id DAA11350; Wed, 4 Sep 2002 03:49:08 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Newsgroups: comp.std.c++
X-Reply-To: steve@steveheller.com
X-Newsreader: Forte Agent 1.91/32.564
X-NNTP-Posting-Date: Tue, 03 Sep 2002 09:54:29 CDT
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.1
Xref: archiver1.google.com comp.std.c++:13575

kanze@gabi-soft.de (James Kanze) wrote:

>Allan_W@my-dejanews.com (Allan W) wrote in message
>news:<23b84d65.0208081146.169d3d83@posting.google.com>...
>> rmaddox@isicns.com (Randy Maddox) wrote
>> > The other issue is that with either the newly proposed use of
>> > explicit or with the private declaration and no definition idiom you
>> > can partially change your mind, i.e., add any one of the prohibited
>> > operations without affecting the remaining prohibitions.  With
>> > boost::noncopyable it's all or nothing.
>
>> Note that you can implement copy constructor in terms of assignment:
>>     T::T(const T&t) { (*this)=t; }
>> Also, while it's not a good idea to implement assignment in terms of
>> copy constructor, it is at least possible.
>
>> Can you think of an example where you'd want to define one of these
>> functions but not the others? I can't.
>
>Yes.  Polymorphism and assignment doesn't work well together, 

Unless you use "safe polymorphism", which hides the pointer in a
"manager" object which can be assigned with normal syntax.

>but it is
>not unusual to want to be able to clone a polymorphic object.  In such
>cases, I'll declare both the copy constructor and the assignment
>operator private; I'll define the copy constructor, but not the
>assignment operator.


--
Steve Heller
http://www.steveheller.com
Author of "C++: A Dialog", "Optimizing C++", and other books
Free online versions of "Who's Afraid of C++?" and "Optimizing C++" are now available
at http://www.steveheller.com/whos and http://www.steveheller.com/opt

---
[ 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                       ]



