home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!deci.cs.umn.edu!hansen
- From: hansen@deci.cs.umn.edu (David M. Hansen)
- Subject: Re: Is Ctor X() required for the object of class X to be able to be dynamically allocated?
- Message-ID: <1992Nov20.184707.317@news2.cis.umn.edu>
- Keywords: constructor X(), dynamic allocation
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: deci.cs.umn.edu
- Organization: University of Minnesota
- References: <BxxC3p.Btn@math.uwaterloo.ca> <1992Nov19.191043.18010@bellahs.com> <1992Nov20.080626.9582@netcom.com>
- Date: Fri, 20 Nov 1992 18:47:07 GMT
- Lines: 14
-
- In article <1992Nov20.080626.9582@netcom.com>, ort@netcom.com (David Oertel) writes:
- |>
- |> This is wrong, the compiler should automatically generate the
- |> default constructor as well as the copy constructor, the assignment
- |> operator, and the address-of operators, if you don't explicitly
- |> specify them.
-
- From the ARM, section 12.1, p. 264: "A default constructor will be generated
- for a class X only if no constructor has been declared for class X.
-
- So, the default ctor will not be generated if you declare a constructor that
- requires one or more parameters.
-
- -=Dave
-