Bug 275191
| Summary: | Make WTF containers std::ranges compatible | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> |
| Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | achristensen, cdumez, darin, koivisto, webkit-bug-importer, ysuzuki, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=286548 | ||
Sam Weinig
Many of the containers defined in WTF are not compatible with std::ranges, mostly due to invalid iterator implementations.
To allow using std::ranges, we should update the implementations to conform to the associated concepts and then statically assert the concepts hold.
The easiest way to test if a container is compatible with std::ranges is to compile the code:
```
static_assert(std::range<ContainerName>);
```
but in general, we should usually be further constraining things with a concept with more requirements. For instance, most of our containers have a known size, so they should at least be "std::sized_range<>".
Similarly, iterators can now be statically asserted as conforming using the iterator concepts: "static_assert(std::forward_iterator<FooIterator>);"
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/129728373>