-
-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sparse_set_iterator::operator[] causes warnings when used with size_t #1134
Comments
Interesting. I've clang-tidy enabled and cannot reproduce it though. |
It's this PR: https://github.com/TheOpenSpaceProgram/osp-magnum/pull/269/files , the file test/tasks/main.cpp which is the very bottom-most file in the review (at the time of writing). The deprecation message says to switch from However, originally (before i just switched to The types are:
rRand is type which apparently returns std::uint_fast32_t and i guess on the github actions runner is of type
The full function is here: since My recommendation is that you can either make the functions for sparse_set_iterator templated on the But don't fix this on my account, since |
Ohoo, I see, so the error is at the call site in your case and not in the body of the function, is it? |
I checked the standard and a few implementations for the major compilers. |
Do you mind sharing some of the random access iterators that you were looking at? I'm curious. |
You can check a few implementations here (working draft for the language). Then I checked the MSVC one from within VS (just look into the implementation of a container like the vector) and the ones offered by clang (easily available online). 👍 |
entt/src/entt/entity/sparse_set.hpp
Line 75 in df87206
Because this function is defined in terms of
Container::difference_type
, usingContainer::size_type
causes a conversion warning. E.g.std::vector::size_type
isstd::size_t
andstd::vector::difference_type
isstd::ptrdiff_t
Shows up in clang-tidy warnings.
The text was updated successfully, but these errors were encountered: