home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / std / cplus / 1533 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.2 KB  |  34 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: Array anachronisms
  5. Message-ID: <1992Nov11.004038.17772@microsoft.com>
  6. Date: 11 Nov 92 00:40:38 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Nov6.190320.1@vax1.bham.ac.uk>
  9. Lines: 23
  10.  
  11. In article <1992Nov6.190320.1@vax1.bham.ac.uk> mccauleyba@vax1.bham.ac.uk (Brian McCauley) writes:
  12. >Why must be live with the anachonistic restictions on the use of array
  13. >variables?
  14.  
  15. I agree with your arguments, but some of the counterarguments are:
  16.  
  17. 1) Its very confusing to have an array mean an array in one context,
  18. and have an array mean a ptr in another context [note however, that
  19. C++ *already* makes this distinction when passing an array by reference
  20. to array]
  21.  
  22. 2) What you ask is already achievable with a slight change of syntax
  23. using templates:
  24.  
  25.     doBlah(array<int,5>)
  26.     {
  27.         ....
  28.     }
  29.  
  30. Since non-C-braindead-flavors of arrays can easily be implemented using
  31. templates, why invent a new slightly-less-braindead implementation of 
  32. arrays built-in to C++?  Instead, lobby the C++ libraries committee to
  33. put the arrays features you like into their proposed array class template.
  34.