#Will a pointer to the child of an optional be invalidated when the entire optional is set to null?

1 messages · Page 1 of 1 (latest)

jaunty cargo
#

it would become invalid, as things stand

#

highly improbable for that to change

lethal ingot
quick fable
#

Well, because there's an extra bit of memory somewhere indicating whether the optional is null, and the payload pointer isn't aware of that - storing e.g. a u32 somewhere can't magically also set that "presence" (not-null) bit, it's just a normal u32 pointer

jaunty cargo
#

Basically all invariants of an optional where is_null = true make the rest of the representation effectively undefined