Re: [GD-General] Offset a void pointer
Brought to you by:
vexxed72
From: Staffan L. <sta...@gb...> - 2004-10-14 17:57:49
|
> 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 |