Skip to content

make Arena::next_index public. - #58

Merged
LPGhatguy merged 1 commit into
LPGhatguy:mainfrom
sanbox-irl:feat/arena-next-index
Aug 19, 2026
Merged

make Arena::next_index public.#58
LPGhatguy merged 1 commit into
LPGhatguy:mainfrom
sanbox-irl:feat/arena-next-index

Conversation

@sanbox-irl

Copy link
Copy Markdown
Contributor

This makes Arena::next_index a public function, which enables knowing the next index which will be used by the arena without owning exclusive access to the arena.

Note this cannot be merged until #57 is merged.

@LPGhatguy

Copy link
Copy Markdown
Owner

This is where that cool new "stacked PRs" feature would be nice, huh.

@sanbox-irl
sanbox-irl force-pushed the feat/arena-next-index branch from 256882a to a4c6968 Compare August 19, 2026 04:10
@sanbox-irl

Copy link
Copy Markdown
Contributor Author

@LPGhatguy yup. rebased for now.

I should say that I tried to make an insert_with_key function here too, but it was just going to wrap the implementation of Arena::vacant_entry, and I realized it wasn't worth doing.

This method gives the user something new -- namely the ability to get the next key immutably. I suspect some users won't need that and getting only mutable access will be just fine, but I doubt it!

@LPGhatguy
LPGhatguy merged commit bb50a80 into LPGhatguy:main Aug 19, 2026
2 checks passed
@sanbox-irl
sanbox-irl deleted the feat/arena-next-index branch August 19, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants