diff --git a/src/kdbindings/genindex_array.h b/src/kdbindings/genindex_array.h index 4da17d8..27a54dc 100644 --- a/src/kdbindings/genindex_array.h +++ b/src/kdbindings/genindex_array.h @@ -66,7 +66,8 @@ class GenerationalIndexAllocator return { index, m_entries[index].generation }; } else { // check that we are still within the bounds of uint32_t - if (m_entries.size() + 1 >= std::numeric_limits::max()) { + // (parentheses added to avoid Windows min/max macros) + if (m_entries.size() + 1 >= (std::numeric_limits::max)()) { throw std::length_error(std::string("Maximum number of values inside GenerationalIndexArray reached: ") + std::to_string(m_entries.size())); }