Refactor lifetime model selection into type traits - #69
Open
mingxwa wants to merge 1 commit into
Open
Conversation
Replace the `*_impl` proxy creation functions with type traits that name the selected lifetime model, so that the models can be reused by types other than `proxy` (e.g. an upcoming `box`). No observable behavior change. - Rename the internal `allocated_ptr` class template to `wide_ptr`, and add `allocated_ptr`, `owned_ptr` and `shared_ptr` type traits that select a lifetime model instead of constructing a `proxy` directly. The creation functions now construct `proxy<F>` from the selected pointer type. - Let `inplace_ptr` ignore its first constructor argument so that all owning lifetime models share a uniform `(alloc, args...)` construction signature. - Order the `T&& value` overload first in each creation function family, and renumber the corresponding specs to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the
*_implproxy creation functions with type traits that name the selected lifetime model, so that the models can be reused by types other thanproxy(e.g. an upcomingboxin v5). No observable behavior change.allocated_ptrclass template towide_ptr, and addallocated_ptr,owned_ptrandshared_ptrtype traits that select a lifetime model instead of constructing aproxydirectly. The creation functions now constructproxy<F>from the selected pointer type.inplace_ptrignore its first constructor argument so that all owning lifetime models share a uniform(alloc, args...)construction signature.T&& valueoverload first in each creation function family, and renumber the corresponding specs to match.