Skip to content

Commit

Permalink
Fixing compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Nov 25, 2023
1 parent 6964f16 commit 4c9c466
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/GooseEYE/GooseEYE.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<T::value_type>) {
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) {
Expand Down
1 change: 1 addition & 0 deletions include/GooseEYE/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <memory>
#include <numeric>
#include <string>
#include <type_traits>
#include <vector>

#include <xtensor/xadapt.hpp>
Expand Down

0 comments on commit 4c9c466

Please sign in to comment.