This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
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 (i) 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_typeif(削除) such a type exists (削除ここまで)(追記) the qualified-idPtr::element_typeis valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで); otherwise,TifPtris a class template instantiation of the formSomePointer<T, Args>, whereArgsis zero or more type arguments; otherwise, the specialization is ill-formed.typedef see below difference_type;-2- Type:
Ptr::difference_typeif(削除) such a type exists (削除ここまで)(追記) the qualified-idPtr::difference_typeis 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>if(削除) such a type exists (削除ここまで)(追記) the qualified-idPtr::rebind<U>is valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで); otherwise,SomePointer<U, Args>ifPtris a class template instantiation of the formSomePointer<T, Args>, whereArgsis zero or more type arguments; otherwise, the instantiation ofrebindis ill-formed.
Change 20.2.8.1 [allocator.uses.trait] p1 as indicated:
template <class T, class Alloc> struct uses_allocator;-1- Remark(追記) s (追記ここまで): automatically detects whether
Thas a nestedallocator_typethat is convertible fromAlloc. Meets theBinaryTypeTraitrequirements (20.10.1). The implementation shall provide a definition that is derived fromtrue_typeif(削除) a type (削除ここまで)(追記) the qualified-id (追記ここまで)T::allocator_type(削除) exists (削除ここまで)(追記) is 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::pointerif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::pointeris valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで); otherwise,value_type*.typedef see below const_pointer;-2- Type:
Alloc::const_pointerif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::const_pointeris 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_pointerif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::void_pointeris 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_pointerif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::const_void_pointeris 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_typeif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::difference_typeis 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_typeif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::size_typeis 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_assignmentif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::propagate_on_container_copy_assignmentis 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_assignmentif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::propagate_on_container_move_assignmentis 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_swapif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::propagate_on_container_swapis 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>::otherif(削除) such a type exists (削除ここまで)(追記) the qualified-idAlloc::rebind<T>::otheris valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで); otherwise,Alloc<T, Args>ifAllocis a class template instantiation of the formAlloc<U, Args>, whereArgsis zero or more type arguments; otherwise, the instantiation ofrebind_allocis ill-formed.
Change 20.3.1.3 [unique.ptr.single] p3 as indicated:
-3- If the
(削除) type (削除ここまで)(追記) qualified-id (追記ここまで)remove_reference_t<D>::pointer(削除) exists (削除ここまで)(追記) is valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで), thenunique_ptr<T, D>::pointershall be a synonym forremove_reference_t<D>::pointer. […]
Change 23.2.4 [sequence.reqmts] p3 as indicated:
-3- In Tables 100 and 101,
Xdenotes a sequence container class,adenotes a value ofXcontaining elements of typeT,AdenotesX::allocator_typeif(削除) it exists (削除ここまで)(追記) the qualified-idX::allocator_typeis valid and denotes a type (13.10.3 [temp.deduct]) (追記ここまで) andstd::allocator<T>if it doesn't, […]