在 C++ 中,是否有针对 "copying" 引用类别和 cv 限定的建议类型特征助手?

In C++ is there a proposed type traits helper for "copying" reference category and cv-qualification?

对于 中假设的调用运算符中的 SFINAE,我需要一个类型特征来“复制”引用类别和 const/volatile 从一种类型到另一种类型的资格:

template <typename T, typename U>
using copy_category_and_qualifications_t = [...];

copy_category_and_qualifications_t<int, char>             // char
copy_category_and_qualifications_t<const int&, char>      // const char&
copy_category_and_qualifications_t<volatile int&&, char>  // volatile char&&

我似乎想起了 type_traits 为此提出的一些建议。有没有人参考过这个提案,或者知道它是为 C++20 还是 C++23 添加的?

P1450 调用此 copy_cvrefclone_cvref(前者只是将限定符应用于第二个参数,后者首先从第二个参数中删除限定符)。前者有用,我想我个人从来没有需要后者。

P0847 uses like_t and forward_like in a few contexts, like_t there is basically P1450's copy_cvref (the latter is... a significantly better name). forward_like is separately proposed in P2445(尽管没有其他类型特征助手)。