home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11497 < prev    next >
Encoding:
Internet Message Format  |  1992-07-25  |  1.2 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!ubc-cs!mala.bc.ca!epp
  2. From: epp@mala.bc.ca (Lorne Epp)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Borland C++ 3.1 fails to conform to C++ Standard
  5. Message-ID: <1992Jul24.133738.597@mala.bc.ca>
  6. Date: 24 Jul 92 13:37:38 -0700
  7. References: <j_ohearn.711991770@dn73>
  8. Distribution: world
  9. Organization: Malaspina College
  10. Lines: 27
  11.  
  12. In article <j_ohearn.711991770@dn73>, j_ohearn@dsg4.dse.beckman.com () writes:
  13. > class Vector
  14. > {
  15. >     double huge *data;
  16. >     unsigned long low, high;
  17. >     public:
  18. >     Vector ( unsigned long, unsigned long );
  19. >     ~Vector(){ delete[] data; }
  20. >     double& operator()( unsigned long i )
  21. >     {
  22. >         return data[i - low]; //Line that offends ver 3.1 but compiled without
  23. >                               //error under 3.0
  24. >     }
  25. > };
  26. > The above class compiled and functioned successfully under version 3.0 
  27. > but under version 3.1 I receive the error message:
  28. >     "Reference initialized with 'double' requires lvalue of type 'double'"
  29. > which referred to the line I have indicated in the above class listing.
  30.  
  31. Just a note:  I have received the same error message for similar code in
  32. Turbo C++ 3.0.
  33.