Is D's pointer subtraction more permissive than C (and C++)?

Ali Çehreli acehreli at yahoo.com
Fri Apr 1 20:22:46 UTC 2022


On 4/1/22 10:39, Steven Schveighoffer wrote:

 > I don't see how the compiler/optimizer
 > can make some other decision based on the subtraction not being between
 > two pointers to the same block of memory.

I think this rule is related to C's accepting wildly different 
platforms, some of which may have different kinds of memory. Two 
pointers to different kinds of memory may not be subtracted.

Ali



More information about the Digitalmars-d mailing list