std::min<unsigned>, for VS2015

fixes #565
This commit is contained in:
Christopher Dunn 2016-12-21 11:09:57 -06:00
parent e25fb5384a
commit 11836ae9aa

View File

@ -303,7 +303,7 @@ bool Value::CZString::operator<(const CZString& other) const {
// Assume both are strings.
unsigned this_len = this->storage_.length_;
unsigned other_len = other.storage_.length_;
unsigned min_len = std::min(this_len, other_len);
unsigned min_len = std::min<unsigned>(this_len, other_len);
JSON_ASSERT(this->cstr_ && other.cstr_);
int comp = memcmp(this->cstr_, other.cstr_, min_len);
if (comp < 0) return true;
@ -566,7 +566,7 @@ bool Value::operator<(const Value& other) const {
char const* other_str;
decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
unsigned min_len = std::min(this_len, other_len);
unsigned min_len = std::min<unsigned>(this_len, other_len);
JSON_ASSERT(this_str && other_str);
int comp = memcmp(this_str, other_str, min_len);
if (comp < 0) return true;