This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/64865] std::allocator::construct/destroy not called for specialization of std::allocator<trivialtype>
- From: "rs2740 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 10:43:02 +0000
- Subject: [Bug libstdc++/64865] std::allocator::construct/destroy not called for specialization of std::allocator<trivialtype>
- Auto-submitted: auto-generated
- References: <bug-64865-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64865
TC <rs2740 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rs2740 at gmail dot com
--- Comment #2 from TC <rs2740 at gmail dot com> ---
(In reply to Casey Carter from comment #0)
> * Close this bug report as WONTFIX since it is horrible design to specialize
> std::allocator instead of declaring a new allocator type; given that
> container implementations are free to rebind to a different specialization,
> there is no guarantee that functionality added to a user-defined
> specialization will even be used.
Since the allocator_type member must be the Alloc template argument provided by
the user and not any rebound types, though, it seems to me that it is in fact
guaranteed that their versions of construct() and destroy() will be called, as
the paragraph you cite requires the use of
allocator_traits<allocator_type>::construct and
allocator_traits<allocator_type>::destroy.