[libcxx-commits] [libcxx] [libc++] Remove assumptions that std::array::iterator is a raw pointer (PR #74624)

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 6 15:10:20 PST 2023


================
@@ -148,14 +151,15 @@ _LIBCPP_HIDE_FROM_ABI auto __format_char(
 // Integer
 //
 
-/** Wrapper around @ref to_chars, returning the output pointer. */
-template <integral _Tp>
-_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, int __base) {
+/** Wrapper around @ref to_chars, returning the output iterator. */
+template <contiguous_iterator _Iterator, integral _Tp>
+_LIBCPP_HIDE_FROM_ABI _Iterator __to_buffer(_Iterator __first, _Iterator __last, _Tp __value, int __base) {
----------------
cjdb wrote:

Could we bubble the changes to the point of use since this is an internal function? That would limit the number of instantiations this function (and other detail functions) ends up generating.

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


More information about the libcxx-commits mailing list