This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/72792] allocator_traits is too strict about rebinding


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]