You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor lifetime model selection into type traits (#69)
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.
`(1)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
23
+
`(1)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<*`std::decay_t<T>`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
24
24
25
-
`(2)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
25
+
`(2)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
26
26
27
-
`(3)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<*`std::decay_t<T>`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
27
+
`(3)` Creates a `proxy<F>` object containing a value `p` of type *allocated-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
28
28
29
29
*Since 3.3.0*: For `(1-3)`, if [`proxiable_target<std::decay_t<T>, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated.
`(1)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
24
+
`(1)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<*`std::decay_t<T>`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
25
25
26
-
`(2)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
26
+
`(2)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
27
27
28
-
`(3)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<*`std::decay_t<T>`*, Alloc>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
28
+
`(3)` Creates a `proxy<F>` object containing a value `p` of type *strong-compact-ptr<T, Alloc>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
29
29
30
30
For `(1-3)`, if [`proxiable_target<std::decay_t<T>, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated.
`(1)` Equivalent to `return make-proxy-internal<F, T>(std::forward<Args>(args)...)`.
34
+
`(1)` Equivalent to `return make-proxy-internal<F, std::decay_t<T>>(std::forward<T>(value))`.
35
35
36
-
`(2)` Equivalent to `return make-proxy-internal<F, T>(il, std::forward<Args>(args)...)`.
36
+
`(2)` Equivalent to `return make-proxy-internal<F, T>(std::forward<Args>(args)...)`.
37
37
38
-
`(3)` Equivalent to `return make-proxy-internal<F, std::decay_t<T>>(std::forward<T>(value))`.
38
+
`(3)` Equivalent to `return make-proxy-internal<F, T>(il, std::forward<Args>(args)...)`.
39
39
40
40
*Since 3.3.0*: For `(1-3)`, if [`proxiable_target<std::decay_t<T>, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated.
`(1)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
30
+
`(1)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<*`std::decay_t`*>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
31
31
32
-
`(2)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
32
+
`(2)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `std::forward<Args>(args)...`.
33
33
34
-
`(3)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<*`std::decay_t`*>*, where `*p` is direct-non-list-initialized with `std::forward<T>(value)`.
34
+
`(3)` Creates a `proxy<F>` object containing a value `p` of type *inplace-ptr<T>*, where `*p` is direct-non-list-initialized with `il, std::forward<Args>(args)...`.
35
35
36
36
*Since 3.3.0*: For `(1-3)`, if [`inplace_proxiable_target<std::decay_t<T>, F>`](inplace_proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated.
`(1)` Equivalent to `return allocate_proxy_shared<F, T>(std::allocator<void>{}, std::forward<Args>(args)...)`.
22
+
`(1)` Equivalent to `return allocate_proxy_shared<F, std::decay_t<T>>(std::allocator<void>{}, std::forward<T>(value))`.
23
23
24
-
`(2)` Equivalent to `return allocate_proxy_shared<F, T>(std::allocator<void>{}, il, std::forward<Args>(args)...)`.
24
+
`(2)` Equivalent to `return allocate_proxy_shared<F, T>(std::allocator<void>{}, std::forward<Args>(args)...)`.
25
25
26
-
`(3)` Equivalent to `return allocate_proxy_shared<F, std::decay_t<T>>(std::allocator<void>{}, std::forward<T>(value))`.
26
+
`(3)` Equivalent to `return allocate_proxy_shared<F, T>(std::allocator<void>{}, il, std::forward<Args>(args)...)`.
27
27
28
28
*Since 3.3.0*: For `(1-3)`, if [`proxiable_target<std::decay_t<T>, F>`](proxiable_target.md) is `false`, the program is ill-formed and diagnostic messages are generated.
0 commit comments