This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

[v3] additions to ext/alloc_traits.h


        * include/ext/alloc_traits.h (__allocator_always_compares_equal): New
        trait, provide partial specializations for known allocators.
        (__alloc_traits::construct, __alloc_traits::destroy): Overload for
        non-standard pointer types.
        (__alloc_traits::_S_always_equal): New trait for use with noexcept.
        (__alloc_traits::_S_nothrow_move): Likewise.
        (__alloc_traits::_S_nothrow_swap): Likewise.

This adds some new traits to __gnu_ext::__alloc_traits which allow
compile-time detection of allocator types that always compare equal,
allowing container operations to be more efficient and marked noexcept
when appropriate.

Tested x86_64-linux, committed to trunk.

Attachment: allocs.txt
Description: Text document


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