Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在尝试实现make_signed_with_fallback非整数类型时,我注意到它std::make_[un]signed旨在复制cv而不是ref限定符,我想知道为什么。
make_signed_with_fallback
std::make_[un]signed
cv
ref
我能想到的唯一解释ref是很少需要复制限定符。
不幸的是,似乎没有任何标准机制可以复制cv或ref限定符从一种类型到另一种类型,我唯一能找到的是type_traits标题中的私有内容(ms,clang,gcc),这让我认为这不是很常见任何一个。
type_traits
我在 SO 上发现了一个关于复制 cv ref 特征的实现的老问题。