ev-abseil-remove-cvref-alias-001¶
| 字段 | 值 |
|---|---|
| 项目 | abseil/abseil-cpp |
| 固定 commit | 2065f4ded055 |
| 路径 | absl/meta/type_traits.h |
| 行段 | L235-L240 |
| 特性 | std::remove_cvref 与 std::type_identity |
| 许可证 | Apache-2.0 |
| 代码来源 | 项目源码 |
| 级别 | manual |
| 审核 | zyuhao7 @ 2026-10-26 |
| 测试代码 | 否 |
| 发现方式 | regex |
用法¶
特性可用时把 remove_cvref 别名到标准实现
为什么典型¶
兼容层保留旧名称,但让 C++20 编译器使用标准库的类型变换,减少重复实现与行为差异。
摘录¶
#if defined(__cpp_lib_remove_cvref) && __cpp_lib_remove_cvref >= 201711L
template <typename T>
using remove_cvref = std::remove_cvref<T>;
template <typename T>
using remove_cvref_t = std::remove_cvref_t<T>;
备注¶
生产路径;由 __cpp_lib_remove_cvref 特性宏保护。