Bug 247607
| Summary: | Replace std::remove_cvref with std::decay where appropriate | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Zan Dobersek <zan> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | darin, fujii.hironori, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=247542 | ||
Zan Dobersek
Bug #247542 placed std::remove_cvref to use where previously std::remove_const/std::remove_cv and std::remove_reference were used together, simply because std::remove_cvref is now available due to C++20 being enforced.
In some cases use of std::decay would be more fitting. Besides whittling down reference and constness for a given type, std::decay also converts array and function types to pointer-based types.
https://en.cppreference.com/w/cpp/types/decay
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Darin Adler
There are many cases where you could use either std::remove_cvref or std::decay, and personally I slightly prefer using std::decay in those cases, perhaps just because "decay" is a word and "cvref" is not.
Radar WebKit Bug Importer
<rdar://problem/102362475>