[libcxx-commits] [libcxx] [libc++] Implement a libc++ private version of isascii (PR #122361)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 9 14:10:16 PST 2025


================
@@ -516,6 +516,8 @@ protected:
 };
 #endif // _LIBCPP_HAS_WIDE_CHARACTERS
 
+inline _LIBCPP_HIDE_FROM_ABI int __libcpp_isascii(int __c) { return (__c & ~0x7F) == 0; }
----------------
philnik777 wrote:

That looks a lot like a C-ism to me. We're returning a boolean expression, so I don't see the harm in making the return type reflect that. We're also not making it part of the locale base API, so there isn't really a direct connection between `__libcpp_isascii` and the extension.

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


More information about the libcxx-commits mailing list