diff --git a/include/GooseEYE/GooseEYE.h b/include/GooseEYE/GooseEYE.h index ba207944..872759a6 100644 --- a/include/GooseEYE/GooseEYE.h +++ b/include/GooseEYE/GooseEYE.h @@ -732,8 +732,15 @@ class ClusterLabeller { { #ifdef GOOSEEYE_ENABLE_ASSERT size_t n = m_label.size(); - GOOSEEYE_ASSERT( - !std::any_of(begin, end, [n](size_t i) { return i < 0 || i >= n; }), std::out_of_range); + if constexpr (std::is_signed_v) { + GOOSEEYE_ASSERT( + !std::any_of(begin, end, [n](size_t i) { return i >= n; }), std::out_of_range); + } + else { + GOOSEEYE_ASSERT( + !std::any_of(begin, end, [n](size_t i) { return i < 0 || i >= n; }), + std::out_of_range); + } #endif for (auto it = begin; it != end; ++it) { diff --git a/include/GooseEYE/config.h b/include/GooseEYE/config.h index 2e7e42b5..1f1a4c21 100644 --- a/include/GooseEYE/config.h +++ b/include/GooseEYE/config.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include