Created on 2010-09-12.00:00:00 last changed 162 months ago
Proposed resolution:
The following wording changes are against N3126.
namespace std { template <class T> struct default_delete { constexpr default_delete() = default; template <class U> default_delete(const default_delete<U>&); void operator()(T*) const; }; }
constexpr default_delete();
1 Effects: Default constructs a default_delete object.
namespace std { template <class T> struct default_delete<T[]> { constexpr default_delete() = default; void operator()(T*) const; template <class U> void operator()(U*) const = delete; }; }
[ Adopted at 2010-11 Batavia ]
[ Post-Rapperswil ]
Moved to Tentatively Ready after 5 positive votes on c++std-lib.
The current working draft does specify the default c'tor of default_delete in a manner to guarantee static initialization for default-constructed objects of static storage duration as a consequence of the acceptance of the proposal n2976 but this paper overlooked the fact that the suggested declaration does not ensure that the type will be a trivial type. The type default_delete was always considered as a simple wrapper for calling delete or delete[], respectivly and should be a trivial type.
In agreement with the new settled core language rules this easy to realize by just changing the declaration to
constexpr default_delete() = default;
This proposal also automatically solves the problem, that the semantics of the default constructor of the partial specialization default_delete<T[]> is not specified at all. By defaulting its default constructor as well, the semantics are well-defined.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-11-23 13:22:14 | admin | set | messages: + msg5409 |
2010-11-14 13:10:57 | admin | set | status: voting -> wp |
2010-11-08 14:14:39 | admin | set | status: ready -> voting |
2010-10-21 19:47:27 | admin | set | messages: + msg4878 |
2010-10-21 19:47:27 | admin | set | messages: + msg4877 |
2010-09-12 00:00:00 | admin | create |