Skip to content
Discussion options

You must be logged in to vote

Yep, that is expected. It is what it is -- the limitations of the current approach are clear, but there isn't an obvious alternative.

Just hypothetically suppose, you pursued the "wrapper" route: you would need a type that intercepts every possible attribute/method access, indexing, etc, and which stores a base pointer to the underlying array and the entry. Calling .update() would then dynamically resolve the current memory address and apply the update.

One reason why I did not pursue this kind of approach is composability: What if the data structure is nested, and we access an element deeper inside? (e.g. foo.data.element[5].member.update(..)). To protect from any memory layout changes o…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@jdumas
Comment options

@wjakob
Comment options

@jdumas
Comment options

@wjakob
Comment options

Answer selected by jdumas
@wjakob
Comment options

@jdumas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants