[PATCH] D25154: [libc++] Fix stack_allocator

Stephan T. Lavavej via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 14:59:10 PDT 2016


STL_MSFT added a comment.

stack_allocator.h is inconsistent about saying plain size_t or std::size_t.

stack_allocator.h should include type_traits for integral_constant.

stack_allocator.h refers to stack_allocator as both a class and a struct. It should be consistent (not just because MSVC complains).

stack_allocator provides copy assign and convert copy assign. This is unnecessary because it doesn't set any of POCCA/POCMA/POCS. It should probably be non-assignable.

For the same reason, stack_allocator probably shouldn't have a do-nothing swap() overload. It won't be used.

In C++11 land, stack_allocator::allocate() doesn't need "const void* = 0" (because allocator_traits will fill it in). Don't know if you need this for C++03 mode.

stack_allocator equality/inequality probably shouldn't be templated on differing TN/UN, as they aren't rebindable that way.

Why does test_stack_allocator.pass.cpp line 11 have a commented-out path?

There is occasional whitespace damage caused by search-and-replace, e.g. "std::list<int, AllocT >".

Why is test/std/containers/sequences/deque/deque.cons/size_value_alloc.pass.cpp 84-85 gaining totally empty braces?


https://reviews.llvm.org/D25154





More information about the cfe-commits mailing list