Thanks a lot for correcting my English. Next time, I will explicitly
ask for a technical answer ;-)

In the code I gave, the memory area between p and (char*)p + l is
valid. Let's suppose that we have
char* c = new char[M]; // M > l
A* p = reinterpret_cast<A*>(c);

I also forgot to tell that this kind of code is used in an allocator.
So please don't tell me that reinterpret_casts are not appropriate in
that case.

I just wondered why
(char*&)p += l;
could be differently compiled than
p = reinterpret_cast<A*>(reinterpret_cast<char*>(p) + l);

If you don't know, kindly avoid answers like "this is not defined in
the C++ standard"

(My message was also posted to gnu.gcc.help and gnu.g++.help)

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to