Use std::numeric_limits<> for typesafe INT_MAX/etc