Date: Wed, 17 Sep 2025 01:05:46 +0300
On 17 Sep 2025 00:58, Julien Villemure-Fréchette via Std-Discussion wrote:
>> One common use case is testing whether the pointers point to a subobject
> of the same object. For example, if a pointer points within a string or
> an array. This check is often needed to properly implement operations on
> the string/array, such as selecting the direction of element iteration.
>
> This case is already well defined in the standard: the last declared member has higher address than the one declared before (unless one has zero size).
But the pointer you're testing may be unrelated to the array.
>> One common use case is testing whether the pointers point to a subobject
> of the same object. For example, if a pointer points within a string or
> an array. This check is often needed to properly implement operations on
> the string/array, such as selecting the direction of element iteration.
>
> This case is already well defined in the standard: the last declared member has higher address than the one declared before (unless one has zero size).
But the pointer you're testing may be unrelated to the array.
Received on 2025-09-16 22:05:49