[libcxx-commits] [libcxx] [libc++] Add an ABI setting to harden unique_ptr<T[]>::operator[] (PR #91798)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 1 07:45:24 PDT 2024


ldionne wrote:

In fact, the memory held by the `unique_ptr` would not even have to be allocated. It could point to a stack variable and the deleter could be a no-op. In that sense, `unique_ptr` with a custom deleter is a bit closer to a `scope_guard`. I think I had that in mind when I made the first implementation a few months, but when I picked it back up recently I remember thinking "oh well it works for custom deleters as well" -- but that was a mistake.

https://github.com/llvm/llvm-project/pull/91798


More information about the libcxx-commits mailing list