gpt4 book ai didi

c++ - std::is_unsigned 是否暗示 std::is_integral

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:12:29 28 4
gpt4 key购买 nike

如果我需要满足 std::is_unsignedstd::is_integral 的类型,我是必须同时检查还是只检查 std::is_unsigned?

最佳答案

cppreference 有此行 is_unsigned ( https://en.cppreference.com/w/cpp/types/is_unsigned ):

this results in true for the unsigned integer types and the type bool and in false for the signed integer types and the floating-point types. For any other type, value is false.

因此,如果 is_unsignedtrue,则 is_integral 也为真。

关于c++ - std::is_unsigned 是否暗示 std::is_integral,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53516497/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com