[libcxx-commits] [PATCH] D152208: [libc++] Introduce __make_uninitialized_buffer and use it instead of get_temporary_buffer

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 7 08:29:27 PDT 2023


ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/__memory/uninitialized_buffer.h:26
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Destructor>
----------------
Can you please document what this class does. In particular, please document how the destructor function gets called (and include what the count represents -- bytes or number of elements). This is pretty obvious if you stop to think about it, but it should be documented.


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/stable_partition.not_enough_memory.pass.cpp:35
+  getGlobalMemCounter()->throw_after = 0;
+  std::stable_partition(forward_iterator(vec.begin()), forward_iterator(vec.end()), [](int i) { return i < 5; });
+
----------------
You should check that the range has been partitioned.

And actually maybe this should be in the general test for `stable_partition`? Same comments below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152208/new/

https://reviews.llvm.org/D152208



More information about the libcxx-commits mailing list