home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!dog.ee.lbl.gov!network.ucsd.edu!mvb.saic.com!unogate!beckman.com!dn73!j_ohearn
- Newsgroups: comp.lang.c++
- Subject: Borland C++ 3.1 fails to conform to C++ Standard
- Message-ID: <j_ohearn.711991770@dn73>
- From: j_ohearn@dsg4.dse.beckman.com ()
- Date: 24 Jul 92 15:29:30 GMT
- Distribution: world
- Keywords: C++ Standard
- Summary: Reference variables and pointers.
- Nntp-Posting-Host: dn73.dse.beckman.com
- Lines: 47
-
-
- Note: This posting is not my own; I am doing this on behalf of one
- of my colleagues, Jack Walker. However, I think he has a valid
- argument.
-
- I have been using a version of the following class which is adapted
- from an example in the Borland C++ 3.0 Programmers Guide (page 149):
-
- class Vector
- {
- double huge *data;
- unsigned long low, high;
-
- public:
-
- Vector ( unsigned long, unsigned long );
- ~Vector(){ delete[] data; }
-
- double& operator()( unsigned long i )
- {
- return data[i - low]; //Line that offends ver 3.1 but compiled without
- //error under 3.0
- }
- };
-
- Vector::Vector(unsigned long L, unsigned long H)
- {
- low = L;
- high = H;
- data = new double huge[H - L + 1];
- }
-
- The above class compiled and functioned successfully under version 3.0
- but under version 3.1 I receive the error message:
- "Reference initialized with 'double' requires lvalue of type 'double'"
- which referred to the line I have indicated in the above class listing.
-
- This contains no syntax error that I am aware of and is essentially given
- in various textbooks on C++ as a method for implementing 'safe arrays'.
-
- I would appreciate any assistance regarding this problem.
-
-
-
- Send any private responses to (I will make sure Jack gets them):
- j_ohearn@dsg4.dse.beckman.com
-
-