Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!scott From: scott@Apple.COM (scott douglass) Newsgroups: comp.std.c++ Subject: Leapin' lvalues Keywords: lvalue Message-ID: <11552@goofy.Apple.COM> Date: 17 Dec 90 21:39:45 GMT Distribution: comp Organization: Apple Computer Inc., Cupertino, CA Lines: 23 Why does the ARM (in section 5) allow some non-traditional (w.r.t. ANSI-C) lvalues? For instance the following statements are legal in C++, but not C: (++i) = 2; // ARM 5.3.1 (i += 3) = 5; // ARM 5.17 But the following is not: (i++) = 7; // ARM 5.2.5 And the following are not explicitly specified: (-i) = 11; // ARM 5.3 (i + 13) = 17; // ARM 5.7 The usefulness of such constructs seems limited. (My guess is that the intent was to allow various user defined operator overloadings to return lvalues. This is not a good reason since section 5 explicitly does not apply to overloaded operators (the commentary even reiterates the point).) Hopefully the standard will explicitly state the lvalue-ness of all expressions.