[libcxx-commits] [PATCH] D148826: [libc++][format] Removes vector dependency.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 22 18:29:45 PDT 2023


philnik added a comment.

Do you plan to move this back to `vector`, or is this a permanent change? If this is permanent, could you maybe elaborate a bit on the exact cycle this creates, and why this can't be resolved by moving the code around a bit?



================
Comment at: libcxx/include/__format/buffer.h:553
+  _LIBCPP_HIDE_FROM_ABI explicit __retarget_buffer(size_t __size_hint) {
+#  if _LIBCPP_STD_VER >= 23
+    allocation_result __result = std::allocate_at_least(__alloc_, __size_hint ? __size_hint : 256 / sizeof(_CharT));
----------------
Why the `#ifdef`? `__allocate_at_least` was specifically designed to be able to write `auto __alloc_result = std::__allocate_at_least(...)`. (Although, thinking about it we should just have a converting constructor from `allocation_result`)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148826



More information about the libcxx-commits mailing list