Bug 273694
| Summary: | Replace potentially more confusing decltype() usage with template lambdas where possible | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> |
| Component: | New Bugs | Assignee: | Diego Pino <dpino> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dpino, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sam Weinig
A somewhat common patter in WebCore is for a callsite to use a generic lambda but still want to know what the type of the generic argument was. Something like:
function([](auto parameter) {
using Type = std::decay_t<decltype(parameter)>;
...
});
This was necessary in the past due to the lack of template lambdas, but now we have them and this can be come:
function([]<typename Type>(Type parameter) {
...
});
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sam Weinig
Pull request: https://github.com/WebKit/WebKit/pull/28109
Radar WebKit Bug Importer
<rdar://problem/127506433>
EWS
Committed 278358@main (5fe8dd6a3b46): <https://commits.webkit.org/278358@main>
Reviewed commits have been landed. Closing PR #28109 and removing active labels.
Diego Pino
Build bot 'GTK-Linux-64-bit-Release-Debian-11-Build' (and others using GCC10) is failing after this patch with the following build error:
https://build.webkit.org/#/builders/992
```
../../../Source/WebCore/platform/graphics/ColorSpace.h:136:69: error: expected ‘(’ before ‘{’ token
136 | return callWithColorType<T>(colorSpace, [&]<typename ColorType> {
| ^
| (
```
Diego Pino
Re-opening for pull request https://github.com/webkit/webkit/pull/28151
EWS
Committed 278386@main (ab7b68fdc266): <https://commits.webkit.org/278386@main>
Reviewed commits have been landed. Closing PR #28151 and removing active labels.