Created on 2017-07-14.00:00:00 last changed 45 months ago
Proposed resolution:
This resolution is relative to N4659.
Edit [util.smartptr.weak], class template weak_ptr synopsis, as indicated:
template<class T> class weak_ptr { public: using element_type = remove_extent_t<T>; […] };
[ 2017-07-17 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]
C++17's shared_ptr<T>::element_type is remove_extent_t<T>, but weak_ptr<T>::element_type is T. They should be the same, but this was lost over time.
First, N4562 "Working Draft, C++ Extensions for Library Fundamentals, Version 2" 8.2.2 [memory.smartptr.weak] specified:namespace std { namespace experimental { inline namespace fundamentals_v2 { template<class T> class weak_ptr { public: typedef typename remove_extent_t<T> element_type;
(The typename here was spurious.)
Then, P0220R1 "Adopt Library Fundamentals V1 TS Components for C++17 (R1)" listed:
8.2.2 Class template weak_ptr
8.2.2.1 weak_ptr constructors
This obscured the fact that the Library Fundamentals TS had altered weak_ptr::element_type.
Finally, P0414R2 "Merging shared_ptr changes from Library Fundamentals to C++17" missed the change to weak_ptr::element_type, so it wasn't applied to C++17. Peter Dimov has confirmed that this was unintentionally lost, and that "boost::weak_ptr defines element_type in the same way as shared_ptr".History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2017-11-13 19:01:36 | admin | set | status: voting -> wp |
2017-10-17 18:35:42 | admin | set | status: ready -> voting |
2017-07-17 16:37:46 | admin | set | messages: + msg9431 |
2017-07-17 16:37:46 | admin | set | status: new -> ready |
2017-07-16 13:18:32 | admin | set | messages: + msg9408 |
2017-07-14 00:00:00 | admin | create |