Skip to content

registry.ctx().get() reference safety / duration? #1260

Answered by skypjack
furrz asked this question in Q&A
Discussion options

You must be logged in to vote

Values are stored as basic_any<0u>s. The 0u there is the size of the internal buffer of the basic_any. That is, it forces a memory allocation, because there is no built-in buffer to avoid it. So, yeah, references should remain stable until you erase the variable or destroy the registry.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by furrz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion it sounds interesting, let's discuss it
2 participants