Re: Offset a void pointer
"Staffan Langin" <[email protected]> Thu, 14 Oct 2004 20:05:07 +0200
| Newsgroups | gmane.games.devel.general |
|---|---|
| Message-ID | <009701c4b218$56f2d2d0$0200a8c0@boman> |
> I don't think so. I think it's more that they're catching up with iso > c++ 99 standard, as most compilers, including MS ones, do. In fact, > that change happened at the same time they rewrote their c++ parser > from scratch to attain better standard conformance. > They refer is as "cast-to-lvalue *extension*", which imo imply that > it's not part of the standard. None of the constructs in this thread have been using the "cast-as-lvalue extension" of GCC. The extension is transparently converting an rvalue to an lvalue. That's why the example, char *p; ((int *) p)++; compiles. The cast (int*) should result in an rvalue, hence applying the post inc. operator shouldn't be legal. There is no rule that explicitly prohibits casting an lvalue of one type to an lvalue of another type. But I agree that (char*&)BufferPtr+=stride looks unintuitive. Staffan ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Gamedevlists-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=557