Created on 2017-02-03.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4640 as modified by the proposed resolution of LWG 2802.
Modify [util.smartptr.shared.const] as indicated:
template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);-8- Requires:
D shall be MoveConstructible and cConstruction of d and a deleter of type D initialized with std::move(d) shall not throw exceptions. The expression d(p)shall be well formed,shall have well-defined behavior, and shall not throw exceptions. A shall be an allocator (17.5.3.5).When T is U[N], Y(*)[N] shall be convertible to T*; when T is U[], Y(*)[] shall be convertible to T*; otherwise, Y* shall be convertible to T*.
Add a Remarks paragraph after p11:
template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);-8- Requires: […]
[…] -11- Throws: […] -?- Remarks: When T is an array type, this constructor shall not participate in overload resolution unless is_move_constructible_v<D> is true, the expression d(p) is well-formed, and either T is U[N] and Y(*)[N] is convertible to T*, or T is U[] and Y(*)[] is convertible to T*. When T is not an array type, this constructor shall not participate in overload resolution unless is_move_constructible_v<D> is true, the expression d(p) is well-formed, and Y* is convertible to T*.
[ Kona 2017-02-27 ]
Accepted as Immediate to resolve NB comment.
[ Kona 2017-02-27: Jonathan updates wording after LWG review ]
[ 2017-02-23, Jonathan provides wording ]
This wording is relative to N4640.
Modify [util.smartptr.shared.const] as indicated:
If the proposed resolution of LWG 2802 has been accepted modify p8 as shown:
template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);-8- Requires:
D shall be MoveConstructible and cConstruction of d and a deleter of type D initialized with std::move(d) shall not throw exceptions. The expression d(p)shall be well formed,shall have well-defined behavior, and shall not throw exceptions. A shall be an allocator (17.5.3.5).When T is U[N], Y(*)[N] shall be convertible to T*; when T is U[], Y(*)[] shall be convertible to T*; otherwise, Y* shall be convertible to T*.
If the proposed resolution of LWG 2802 has not been accepted modify p8 as shown:
template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);-8- Requires:
D shall be CopyConstructible and such cConstruction of d and a copy of d shall not throw exceptions. The destructor of D shall not throw exceptions. The expression d(p)shall be well formed,shall have well defined behavior, and shall not throw exceptions. A shall be an allocator (17.5.3.5). The copy constructor and destructor of A shall not throw exceptions.When T is U[N], Y(*)[N] shall be convertible to T*; when T is U[], Y(*)[] shall be convertible to T*; otherwise, Y* shall be convertible to T*.
In either case, add a Remarks paragraph after p11:
[Drafting note: If LWG 2802 is not accepted, replace is_move_constructible_v with is_copy_constructible_v.]
template<class Y, class D> shared_ptr(Y* p, D d); template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a);-8- Requires: […]
[…] -11- Throws: […] -?- Remarks: When T is an array type, this constructor shall not participate in overload resolution unless is_move_constructible_v<D> is true, the expression d(p) is well-formed, and either T is U[N] and Y(*)[N] is convertible to T*, or Y(*)[] is convertible to T*. When T is not an array type, this constructor shall not participate in overload resolution unless is_move_constructible_v<D> is true, the expression d(p) is well-formed, and Y* is convertible to T*.
[ 2017-02 pre-Kona ]
See US 125: LWG 2874.
Addresses US 126
Paragraph 8: This constructor should not participate in overload resolution unless the Requires clause is satisfied. Note that this would therefore apply to some assignment operator and reset overloads, via Effects: equivalent to some code wording.
Proposed change:
Add a Remarks: clause to constrain this constructor not to participate in overload resolution unless the Requires clause is satisfied.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2017-03-05 23:46:08 | admin | set | status: immediate -> wp |
2017-03-03 22:08:49 | admin | set | messages: + msg9057 |
2017-03-03 22:08:49 | admin | set | status: new -> immediate |
2017-02-28 03:05:42 | admin | set | messages: + msg9010 |
2017-02-23 21:46:30 | admin | set | messages: + msg8992 |
2017-02-23 21:46:30 | admin | set | messages: + msg8991 |
2017-02-03 21:14:26 | admin | set | messages: + msg8865 |
2017-02-03 00:00:00 | admin | create |