🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2527

When must an implictly defined assigment operator be generated

#2527
From: Jody Goldberg
Date: Fri, 10 Nov 1995 19:53
22 lines
1400 bytes
class A
{
    A & operator(A const &);  // it is private
};

class B : public A
{
};

// B does not define a copy assignment operator and it is not called in the
// translation unit
// WP 12.8 para 12 states that implicitly defining a copy assigment operator
// makes the program ill formed only if it is called.  Can a conformant
// compiler compile the above code without error ?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jody+@cmu.edu  |   - veni vidi nuclei deceiri -
               |   I came, I saw, I dumped core
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <199511101951.OAA18436@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 10 Nov 95 19:53:51 GMT
Approved: fjh@cs.mu.oz.au
Organization: -
Newsgroups: comp.std.c++
Message-ID: <199511101951.OAA18436@andrew.cmu.edu>
X-Original-Date: Fri, 10 Nov 95 14:51:15 -0500
From: Jody Goldberg <jody+@cmu.edu>
X-Mailer: Mozilla 1.12 (X11; I; Linux 1.2.13 i586)
Subject: When must an implictly defined assigment operator be generated
X-Url: http://dogbert.lbl.gov/~matt/std-c++/charter.html
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMKOt5+EDnX0m9pzZAQFs0QF+PSoUSuwEQGUy/jcHvAmXl3yxfyNMsecn
 CCqi3Ads2HXYVOgExiCn4ZStCQ+dUKzv
 =Z6lM