Created on 2008-03-30.00:00:00 last changed 162 months ago
Proposed resolution:
Add to class template definition in [unique.ptr.runtime]
// modifiers pointer release(); void reset(pointer p = pointer()); void reset( nullptr_t ); template< typename U > void reset( U ) = delete; void swap(unique_ptr&& u);
Update [unique.ptr.runtime.modifiers]
void reset(pointer p = pointer()); void reset(nullptr_t);
-1- Requires: Does not accept pointer types which are convertible to pointer (diagnostic required). [Note: One implementation technique is to create a private templated overload. -- end note]Effects: If get() == nullptr there are no effects. Otherwise get_deleter()(get()).
...
Reading resolution of LWG issue 673 I noticed the following:
void reset(T*pointer p =0pointer());-1- Requires: Does not accept pointer types which are convertible to
T*pointer (diagnostic required). [Note: One implementation technique is to create a private templated overload. -- end note]
This could be cleaned up by mandating the overload as a public deleted function. In addition, we should probably overload reset on nullptr_t to be a stronger match than the deleted overload. Words...
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg3919 |
2010-10-21 18:28:33 | admin | set | messages: + msg3918 |
2008-03-30 00:00:00 | admin | create |