jfalcou / kumi

C++20 Compact Tuple Tools
https://jfalcou.github.io/kumi/
Boost Software License 1.0
47 stars 7 forks source link

[BUG] Spurious warning when using iota with signed integers as seed #70

Closed hiGepi closed 1 year ago

hiGepi commented 1 year ago

Describe the bug

/home/higepi/stage/kiwaku/test/algorithms/find.cpp:58:22: note: in instantiation of function template specialization 'kumi::iota<4UL, int>' requested here
  auto vdata = kumi::iota<4>(1);
                     ^
In file included from /home/higepi/stage/kiwaku/test/algorithms/find.cpp:9:
In file included from /home/higepi/stage/kiwaku/include/kwk/algorithm/find.hpp:10:
In file included from /home/higepi/stage/kiwaku/include/kwk/concepts/container.hpp:13:
In file included from /home/higepi/stage/kiwaku/include/kwk/settings/size.hpp:10:
In file included from /home/higepi/stage/kiwaku/include/kwk/utility/container/shape.hpp:12:
/home/higepi/stage/kiwaku/include/kwk/detail/kumi.hpp:1098:28: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
      return kumi::tuple{T(v+I)...};
                           ^~
/home/higepi/stage/kiwaku/include/kwk/detail/kumi.hpp:1098:28: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
      return kumi::tuple{T(v+I)...};
                           ^~
/home/higepi/stage/kiwaku/include/kwk/detail/kumi.hpp:1098:28: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
      return kumi::tuple{T(v+I)...};

To Reproduce auto vdata = kumi::iota<4>(1);

Expected behavior Iota must compile without warning