-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
I'm creating a data structure that includes Boxes and Vecs and Vecs of Boxes, and I find myself between two choices:
- Have the top-level data structure own the
Allocatorand have each nested structure use the free&Aimplementation - Require the
Allocatorto beCloneand justcloneit at each usage point
Based on this section in the docs:
cloning or moving the allocator must not invalidate memory blocks returned from this allocator. A cloned allocator must behave like the same allocator
it seems like the expected pattern is 2, and that therefore most allocators will be Clone. Is that correct?
Metadata
Metadata
Assignees
Labels
No labels