Created on 2014-02-13.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N3936.
Change class template shared_ptr synopsis, [util.smartptr.shared], as indicated:
constexpr shared_ptr(nullptr_t) noexcept : shared_ptr() { }
[ 2014-03-26 Library reflector vote ]
The issue has been identified as Tentatively Ready based on six votes in favour.
The declaration and definition of shared_ptr::shared_ptr(nullptr_t), given in [util.smartptr.shared], is
constexpr shared_ptr(nullptr_t) : shared_ptr() { }
The intention seems clear: this constructor should have the same semantics of the default constructor. However, contrarily to the default constructor, this one is not noexcept. In contrast, unique_ptr::unique_ptr(nullptr_t) is noexcept, as per [unique.ptr.single]:
constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { }
Both libstdc++ and libc++ have added noexcept to shared_ptr::shared_ptr(nullptr_t). Microsoft's STL has not.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2014-11-08 19:44:42 | admin | set | status: voting -> wp |
2014-11-04 10:26:50 | admin | set | status: ready -> voting |
2014-03-26 21:11:34 | admin | set | messages: + msg6924 |
2014-03-26 21:11:34 | admin | set | status: new -> ready |
2014-03-23 20:27:06 | admin | set | messages: + msg6905 |
2014-02-13 00:00:00 | admin | create |