From -5310358261727333260
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,5e69b3c02624e7d0
X-Google-Attributes: gidf78e5,public
From: "Andrew R. Thomas-Cramer" <artc@prism-cs.com>
Subject: Re: A C++ asymmetry
Date: 1999/09/14
Message-ID: <37de5f2f$0$91176@news.execpc.com>#1/1
X-Deja-AN: 525022348
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <yfHaNyPjoGWxa6bbbTdKITIXiWzP@4ax.com>
X-Original-Date: Tue, 14 Sep 1999 09:45:22 -0500
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: ariel.ucs.unimelb.edu.au 937324777 1080 128.250.37.153 (14 Sep 1999 15:59:37 GMT)
Organization: ExecPC Internet - Milwaukee, WI
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN95w4OEDnX0m9pzZAQFIPgF7BAqhpe1mkQDXnmqQCGEdMGMrodS8T5i3 f7hXQPp0zjCuJ9iKCmuz0BgC7Miv4go7 =I9yl
NNTP-Posting-Date: 14 Sep 1999 15:59:37 GMT
Newsgroups: comp.std.c++

1. Compatibility with C.
   One of C++'s goals is backwards compatibility with C. ANSI C structs
implicitly support copy and assignment, even if someone's written one or
more initialization functions for the struct. The present rule thus makes
classes behave similarly to C structs.

2. Parallelism
   If copy constructors were created implicitly only if _no_ other
constructors were defined,  either the assignment operator would either need
to follow the same rule, or not. If it did, defining a single constructor
explicitly would turn off the implicit assignment operator, which seems an
unnatural dependency. If it didn't, it would not satisfy parallelism with
the copy constructor, and a particular class could have an implicit
assignment operator but not an implicit copy constructor.

3. Utility
  Mr. Glassborow covered this in a previous article.
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



