From a03c35fad7f1ac825da99f99ccf186e20c542eaa Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 30 Jan 2026 14:29:12 +0100 Subject: [PATCH] [libc++][NFC] Avoid checking that string::iterator is a contiguous iterator (#178636) `__is_continuation` is only used in contexts where we already know that the argument is a contiguous iterator. However, due to the context in which it is used, we check it as soon as the header is included. The `contiguous_iterator` check is quite expensive (~12ms on my system), so avoiding it reduces compile times for quite a few headers, including ``. --- libcxx/include/__format/unicode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/__format/unicode.h b/libcxx/include/__format/unicode.h index 46096fda1e8a..dbb87f2d711b 100644 --- a/libcxx/include/__format/unicode.h +++ b/libcxx/include/__format/unicode.h @@ -101,7 +101,7 @@ inline constexpr __consume_result __consume_result_error{__replacement_character return __unicode::__is_code_point(__value) && !__unicode::__is_surrogate(__value); } -template +template requires same_as, char> _LIBCPP_HIDE_FROM_ABI constexpr bool __is_continuation(_Iterator __char, int __count) { do {