Bug 247607 - Replace std::remove_cvref with std::decay where appropriate
Summary: Replace std::remove_cvref with std::decay where appropriate
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-11-08 04:21 PST by Zan Dobersek
Modified: 2022-11-15 04:22 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2022-11-08 04:21:22 PST
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
Comment 1 Darin Adler 2022-11-08 08:59:06 PST
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.
Comment 2 Radar WebKit Bug Importer 2022-11-15 04:22:16 PST
<rdar://problem/102362475>