计算类型范围

Calculated type range

本文关键字:范围 类型 计算      更新时间:2023-10-16

>假设我有以下内容

class X {
    typedef some_numeric_type my_type;
}

如何确定该my_type的极限?

<limits>标头中的std::numeric_limits

#include <limits>
std::numeric_limits<my_type>::min()
std::numeric_limits<my_type>::max()