https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70472

--- Comment #7 from TC <rs2740 at gmail dot com> ---
(In reply to Jonathan Wakely from comment #6)
> (In reply to TC from comment #5)
> > In any event, it would be wrong to SFINAE on
> > std::is_copy_constructible<value_type>. The requirement is CopyInsertable,
> > not CopyConstructible. The allocator's construct() can mutilate the
> > constructor arguments to its heart's content before passing them on, and I
> > don't see a way to check this.
> 
> <bits/alloc_traits.h> has this:
> 
>   // true if _Alloc::value_type is CopyInsertable into containers using
> _Alloc
>   template<typename _Alloc>
>     struct __is_copy_insertable
>     : __is_copy_insertable_impl<_Alloc>::type
>     { };
> 
> But using it requires that std::vector::~vector() is defined as defaulted,
> which would not be a simple change.
> 
> We used to use that for the unordered containers until r204790.

That also requires the allocator's `construct` be SFINAE-friendly. Most aren't.

Reply via email to