Section: 20.3.1.3 [unique.ptr.single], 20.2.3.2 [pointer.traits.types], 20.2.8.1 [allocator.uses.trait], 20.2.9.2 [allocator.traits.types], 23.2.4 [sequence.reqmts] Status: C++17 Submitter: Jonathan Wakely Opened: 2014-02-14 Last modified: 2017-07-30
Priority: Not Prioritized
View other active issues in [unique.ptr.single].
View all other issues in [unique.ptr.single].
View all issues with C++17 status.
Discussion:
LWG 2299 addressed a N.B. comment pointing out that recently added wording about a type existing was not clear what happens if the type exists but is inaccessible. There are 16 pre-existing uses of the same language in the library that should use the same wording used to resolve 2299.
The relevant paragraphs are:
20.3.1.3 [unique.ptr.single]
20.2.3.2 [pointer.traits.types] 20.2.8.1 [allocator.uses.trait] 20.2.9.2 [allocator.traits.types] 23.2.4 [sequence.reqmts][2014-05-16, Daniel provides wording]
[2014-05-18 Library reflector vote]
The issue has been identified as Tentatively Ready based on six votes in favour.
Proposed resolution:
This wording is relative to N3936.
Change 20.2.3.2 [pointer.traits.types] as indicated:
typedef see below element_type;-1- Type:
Ptr::element_type
ifsuch a type existsthe qualified-idPtr::element_type
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,T
ifPtr
is a class template instantiation of the formSomePointer<T, Args>
, whereArgs
is zero or more type arguments; otherwise, the specialization is ill-formed.typedef see below difference_type;-2- Type:
Ptr::difference_type
ifsuch a type existsthe qualified-idPtr::difference_type
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,std::ptrdiff_t
.template <class U> using rebind = see below;-3- Alias template:
Ptr::rebind<U>
ifsuch a type existsthe qualified-idPtr::rebind<U>
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,SomePointer<U, Args>
ifPtr
is a class template instantiation of the formSomePointer<T, Args>
, whereArgs
is zero or more type arguments; otherwise, the instantiation ofrebind
is ill-formed.
Change 20.2.8.1 [allocator.uses.trait] p1 as indicated:
template <class T, class Alloc> struct uses_allocator;-1- Remarks: automatically detects whether
T
has a nestedallocator_type
that is convertible fromAlloc
. Meets theBinaryTypeTrait
requirements (20.10.1). The implementation shall provide a definition that is derived fromtrue_type
ifa typethe qualified-idT::allocator_type
existsis valid and denotes a type (13.10.3 [temp.deduct]) andis_convertible<Alloc, T::allocator_type>::value != false
, otherwise it shall be derived fromfalse_type
. […]
Change 20.2.9.2 [allocator.traits.types] as indicated:
typedef see below pointer;-1- Type:
Alloc::pointer
ifsuch a type existsthe qualified-idAlloc::pointer
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,value_type*
.typedef see below const_pointer;-2- Type:
Alloc::const_pointer
ifsuch a type existsthe qualified-idAlloc::const_pointer
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,pointer_traits<pointer>::rebind<const value_type>
.typedef see below void_pointer;-3- Type:
Alloc::void_pointer
ifsuch a type existsthe qualified-idAlloc::void_pointer
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,pointer_traits<pointer>::rebind<void>
.typedef see below const_void_pointer;-4- Type:
Alloc::const_void_pointer
ifsuch a type existsthe qualified-idAlloc::const_void_pointer
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,pointer_traits<pointer>::rebind<const void>
.typedef see below difference_type;-5- Type:
Alloc::difference_type
ifsuch a type existsthe qualified-idAlloc::difference_type
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,pointer_traits<pointer>::difference_type
.typedef see below size_type;-6- Type:
Alloc::size_type
ifsuch a type existsthe qualified-idAlloc::size_type
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,make_unsigned_t<difference_type>
.typedef see below propagate_on_container_copy_assignment;-7- Type:
Alloc::propagate_on_container_copy_assignment
ifsuch a type existsthe qualified-idAlloc::propagate_on_container_copy_assignment
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,false_type
.typedef see below propagate_on_container_move_assignment;-8- Type:
Alloc::propagate_on_container_move_assignment
ifsuch a type existsthe qualified-idAlloc::propagate_on_container_move_assignment
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,false_type
.typedef see below propagate_on_container_swap;-9- Type:
Alloc::propagate_on_container_swap
ifsuch a type existsthe qualified-idAlloc::propagate_on_container_swap
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,false_type
.template <class T> using rebind_alloc = see below;-10- Alias template:
Alloc::rebind<T>::other
ifsuch a type existsthe qualified-idAlloc::rebind<T>::other
is valid and denotes a type (13.10.3 [temp.deduct]); otherwise,Alloc<T, Args>
ifAlloc
is a class template instantiation of the formAlloc<U, Args>
, whereArgs
is zero or more type arguments; otherwise, the instantiation ofrebind_alloc
is ill-formed.
Change 20.3.1.3 [unique.ptr.single] p3 as indicated:
-3- If the
typequalified-idremove_reference_t<D>::pointer
existsis valid and denotes a type (13.10.3 [temp.deduct]), thenunique_ptr<T, D>::pointer
shall be a synonym forremove_reference_t<D>::pointer
. […]
Change 23.2.4 [sequence.reqmts] p3 as indicated:
-3- In Tables 100 and 101,
X
denotes a sequence container class,a
denotes a value ofX
containing elements of typeT
,A
denotesX::allocator_type
ifit existsthe qualified-idX::allocator_type
is valid and denotes a type (13.10.3 [temp.deduct]) andstd::allocator<T>
if it doesn't, […]