CSGuide icon indicating copy to clipboard operation
CSGuide copied to clipboard

实现 `is_integral` 时的错误

Open liginity opened this issue 9 months ago • 0 comments

docs/cpp/modern_cpp/type_traits.md 展示如何实现 is_integral 模板时,使用了 std::remove_cv 模板,这是不应该使用的。对于 intint& 两个类型,std::is_integral<T>::value 分别是真和假。

见 godbolt 例子

liginity avatar Mar 11 '25 02:03 liginity