Created on 2017-09-13.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4849.
Edit [util.smartptr.shared] as indicated:
[…]
-2- Specializations of shared_ptr shall be Cpp17CopyConstructible, Cpp17CopyAssignable, and Cpp17LessThanComparable, allowing their use in standard containers. Specializations of shared_ptr shall be contextually convertible to bool, allowing their use in boolean expressions and declarations in conditions.The template parameter T of shared_ptr may be an incomplete type.-?- The template parameter T of shared_ptr may be an incomplete type. [Note: T may be a function type. -- end note] […]
[ 2020-02 Friday AM discussion in Prague. ]
Marshall provides updated wording; status to Immediate
[ 2020-02-13; Prague ]
LWG would prefer to make the new constraint a Mandates-like thing.
Original resolution [SUPERSEDED]:
This wording is relative to N4849.
Edit [util.smartptr.shared] as indicated:
[…]
-2- Specializations of shared_ptr shall be Cpp17CopyConstructible, Cpp17CopyAssignable, and Cpp17LessThanComparable, allowing their use in standard containers. Specializations of shared_ptr shall be contextually convertible to bool, allowing their use in boolean expressions and declarations in conditions.The template parameter T of shared_ptr may be an incomplete type.-?- The template parameter T of shared_ptr may be an incomplete type. The program is ill-formed unless T* is an object pointer type or a function pointer type. […]
[ 2017-11 Albuquerque Wednesday night issues processing ]
Priority set to 3
Previous resolution [SUPERSEDED]:
This wording is relative to N4687.
Edit [util.smartptr.shared] as indicated:
[…]
-2- Specializations of shared_ptr shall be CopyConstructible, CopyAssignable, and LessThanComparable, allowing their use in standard containers. Specializations of shared_ptr shall be contextually convertible to bool, allowing their use in boolean expressions and declarations in conditions.The template parameter T of shared_ptr may be an incomplete type.-?- The template parameter T of shared_ptr may be an incomplete type. T* shall be an object pointer type or a function pointer type. […]
shared_ptr has been designed to support use cases where it owns a pointer to function, and whose deleter does something with it. This can be used, for example, to keep a dynamic library loaded for as long as their exported functions are referenced.
Implementations have overlooked that the T in shared_ptr<T> can be a function type. It isn't immediately obvious from the standard, and it's not possible to tell from the wording that this is intentional.History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: immediate -> wp |
2020-02-14 10:54:21 | admin | set | messages: + msg11110 |
2020-02-14 10:54:21 | admin | set | status: new -> immediate |
2020-02-13 21:50:15 | admin | set | messages: + msg11088 |
2017-11-09 15:13:04 | admin | set | messages: + msg9519 |
2017-09-13 19:21:17 | admin | set | messages: + msg9462 |
2017-09-13 00:00:00 | admin | create |