计算的类型范围

Ole*_*egG 2 c++ types

假设我有以下内容

class X {
    typedef some_numeric_type my_type;
}
Run Code Online (Sandbox Code Playgroud)

如何确定限制my_type

jua*_*nza 7

std::numeric_limits<limits>报头.

#include <limits>

std::numeric_limits<my_type>::min()
std::numeric_limits<my_type>::max()
Run Code Online (Sandbox Code Playgroud)