[libc++] Split allocator_traits and pointer_traits out of <memory>
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 10 Dec 2020 23:28:13 +0000 (18:28 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Mon, 14 Dec 2020 21:13:57 +0000 (16:13 -0500)
commit7ad49aec125b3c1205b164331d0aa954d773f890
tree85d48bebcf0f8aa85f03226b952164d6e8a01b95
parentb6b522c4db17157d871eff974e5283058bc616a1
[libc++] Split allocator_traits and pointer_traits out of <memory>

In addition to making the code a lot easier to grasp by localizing many
helper functions to the only file where they are actually needed, this
will allow creating helper functions that depend on allocator_traits
outside of <memory>.

This is done as part of implementing array support in allocate_shared,
which requires non-trivial array initialization algorithms that would be
better to keep out of <memory> for sanity. It's also a first step towards
splitting up our monolithic headers into finer grained ones, which will
make it easier to reuse functionality across the library. For example,
it's just weird that we had to define `addressof` inside <type_traits>
to avoid circular dependencies -- instead it's better to implement those
in true helper headers.

Differential Revision: https://reviews.llvm.org/D93074
libcxx/include/CMakeLists.txt
libcxx/include/__memory/allocator_traits.h [new file with mode: 0644]
libcxx/include/__memory/base.h [new file with mode: 0644]
libcxx/include/__memory/pointer_traits.h [new file with mode: 0644]
libcxx/include/exception
libcxx/include/iterator
libcxx/include/memory
libcxx/include/type_traits
libcxx/test/std/containers/sequences/vector/vector.cons/copy.move_only.verify.cpp
libcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp