[libcxx-commits] [libcxx] [libc++] Use a custom once_flag implementation for locale::id::__get() (PR #212235)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 3 02:45:16 PDT 2026
philnik777 wrote:
> I am not clearly seeing the benefit of doing this, despite the PR description. What's wrong with using a `once_flag` -- isn't it meant exactly for that purpose? Naively, this seems to be "regressing" since we're reimplementing that we already have a tool for.
>
> I suspect there is a subtlety that would convince me otherwise?
This patch basically combines storing the id and the `once_flag`, which we can't to with the generic `std::once_flag`. (Also, FWIW I feel like `std::once_flag` is meant for some meaningful amount of operations, while the use here is literally just incrementing an atomic value)
https://github.com/llvm/llvm-project/pull/212235
More information about the libcxx-commits
mailing list