我想知道是否有人可以解释为什么是函数而不是常量的std::numeric_limit<T>::min
原因max
?
此外,我想知道可以使用哪些技术来利用最小/最大值作为模板参数的一部分,例如:
template<unsigned long long max>
class foo
{
public:
void boo() { std::cout << max << std::endl; }
};
.
.
.
foo<std::numeric_limits<int>::max()> f;
f.boo();