home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16657 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.2 KB  |  28 lines

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