This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/72792] allocator_traits is too strict about rebinding
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Feb 2017 18:33:48 +0000
- Subject: [Bug libstdc++/72792] allocator_traits is too strict about rebinding
- Auto-submitted: auto-generated
- References: <bug-72792-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72792
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If you don't provide this, then allocator_traits::rebind_alloc can't be used,
even after this bug is fixed. That means you can't use your allocators with
node-based contains like std::list.
So adding the rebind improves your allocators anyway.
Simply removing the static_assert from allocator_traits doesn't make your
allocator more useful, it just means you don't notice the problem until you try
to use it in a node-based container (or with std::allocate_shared, or in
std::promise, or several other places).