[libcxx-commits] [libcxx] [libc++] Optimize `to_chars` for bases 2, 8 and 16 (PR #223222)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 13 23:25:15 PDT 2026


Zingam wrote:

> Seems like a reasonable optimization, but
> 
> * As Zingam mentioned, some of those builtins might need feature-tests. `__builtin_bit_cast` is also more recent than `std::to_chars`.

Aren't builtins typically available to all standard modes? AFAIK you can use those internally to implement stuff for older standards. Apparently we have this internal function: __bit_cast that can be used in C++11 and newer.

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


More information about the libcxx-commits mailing list