Open risa2000 opened 2 years ago
Honestly I don't think that this can be easily avoided. Personally I think that any function that will cast a variable to unsigned should take a variable as unsigned. But that it would be a so great if the compiler would recognise that when you type 2
that it is unsigned and it would not have to worry about it. Instead it thinks: 2
is an integer, that could have been unsigned.
@tdegeus Yes, I guess, it is not really a problem in xtensor, but the compiler being too picky. I would however leave the comment here and possibly make a point at Microsoft dev tools forum. It does not make sense to complain note about 2 not being of particular type when the type is basically inferred by the compiler on the fly.
I was updating my project with the recent libs and tools, i.e.
and when compiling this pattern:
I was getting a quite a list of "notes", initiated by a single warning, being caused by the
xt::view(points, xt::all(), 2)
call.The output is here build.log
All complains disappear when I change the code to:
(
size_t
type silences the compiler too and probably other compatible - unsigned - types). While the fix is trivial I believe using2
is perfectly valid. Also, I am not sure if it is because of an overly caring MSVC compiler, or something in xtensor, but if it could be helped in xtensor it would save quite a lot of wasted output lines.