[libcxx-commits] [libcxx] [libc++] Implement LWG4245: Operators that interact with counted_iterator and default_sentinel_t should be noexcept (PR #235445)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Oct 25 20:15:41 PDT 2026


================
@@ -77,6 +77,11 @@ constexpr bool test() {
     {
       std::counted_iterator iter(cpp20_input_iterator<int*>(buffer), 8);
 
+      static_assert(noexcept(iter == std::default_sentinel));
----------------
frederick-vs-ja wrote:

> I'd also assess if we should move it to another function called `test_lwg4245` more or less the same as we did in

I think it's better not to do so when we can modify existing functions without breaking consistency too much.

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


More information about the libcxx-commits mailing list