home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15889 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.5 KB  |  47 lines

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!doc.ic.ac.uk!uknet!news.cs.bham.ac.uk!bham!bhamvx!mccauleyba
  2. From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Copying array members
  5. Message-ID: <1992Nov6.190736.1@vax1.bham.ac.uk>
  6. Date: 6 Nov 92 19:07:36 GMT
  7. Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
  8. Organization: University of Birmingham
  9. Lines: 36
  10.  
  11. Perhaps I should RTM but I'm ARMless and cannot find the answer to the
  12. following in "The C++ Programming Language, 2nd Edition".
  13.  
  14. struct A {
  15.   int member;
  16.   A();
  17.   A(const A&);
  18.   A& operator=(const A&);
  19. };
  20.  
  21. struct B {
  22.   A array_member[10];
  23. };
  24.  
  25. Do the compiler generated B::B() B::B(const B&) and B::operator=(const B&)
  26. call their counterparts in A ten times?
  27.  
  28. I could check this on my compiler but I want to know what the _standard_ says
  29. as this is just the sort of thing compilers often get wrong.
  30.  
  31. Is it possible for the programmer to write a B::B(const B&) that calls
  32. A::A(const A&) ten times rather than calling A::A() ten times followed by
  33. A::operator=(const A&) ten times?
  34.  
  35. This opens the whole issue of changing the standard so that one can initilise
  36. an array with another array and assign to array variables.
  37.  
  38. If you with to reply WRT changing the standard, please do *not* do so here.
  39. Please reply to my posting in comp.std.c++ entitled "Array anachronisms".
  40. -- 
  41.     \\   ( )  NO BULLSHIT! from BAM (Brian McCauley)          
  42.  .  _\\__[oo  ============
  43. .__/  \\ /\@
  44. .  l___\\     E-mail: B.A.McCauley@bham.ac.uk
  45.  # ll  l\\ 
  46. ###LL  LL\\
  47.