[Webkit-unassigned] [Bug 275191] New: Make WTF containers std::ranges compatible

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 5 19:08:36 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=275191

            Bug ID: 275191
           Summary: Make WTF containers std::ranges compatible
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sam at webkit.org

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>);"

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240606/3a737fcb/attachment.htm>


More information about the webkit-unassigned mailing list