2012-10-04 87 views

回答

7

<limits>标题中的std::numeric_limits

#include <limits> 

std::numeric_limits<my_type>::min() 
std::numeric_limits<my_type>::max() 
+0

你能告诉我这个招数的代码吗? – OlegG

+0

@OlegG,[参考](http://en.cppreference.com/w/cpp/types/numeric_limits)怎么样? – chris

+0

@OlegG你的意思是代码在实现中,还是如何使用它?实施本身不是标准要求的。 – juanchopanza