[libcxx-commits] [libcxx] [libc++] Classify iota_view precondition (PR #96662)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 25 18:41:35 PDT 2024


frederick-vs-ja wrote:

Any thoughts on this concern? 

> I was also wondering if instead of raising the error via a failure in the requires clause of the `iota_view` constructor guideline, it could be maybe raised earlier, e.g., from `iota` itself, with a nice message.

I've roughly tested the idea
- extract a new `_Integer_like_types_signedness_mismatch` variable,
- use it in the constraints of the deduction guide, and then
- copy the constraints of `iota_view` and its deduction guide to `__iota::__fn::operator()`.

Error messages seem improved ([Godbolt link](https://godbolt.org/z/7836vWfr1)).

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


More information about the libcxx-commits mailing list