Skip to content
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

KdTree assert out of range on MSVC #108

Open
AlexeySmolenchuk opened this issue Jan 26, 2025 · 1 comment
Open

KdTree assert out of range on MSVC #108

AlexeySmolenchuk opened this issue Jan 26, 2025 · 1 comment

Comments

@AlexeySmolenchuk
Copy link
Contributor

I'm compiling this project with the MSVC. In debug mode tests asserting with Expression: vector subscript out of range for &_ids[n+size]

    std::nth_element(&_ids[n], &_ids[n+left], &_ids[n+size],
		     ComparePointsById(&_points[0].p[j]));

here
https://github.com/wdas/partio/blob/main/src/lib/core/KdTree.h#L328

I know the algorithm never reaches the _ids[n+size] element, but I can't persuade the compiler.

Thank you

@davvid
Copy link
Member

davvid commented Feb 12, 2025

I'm not familiar with MSVC so I can't help much with that aspect.

I do see that we use pragmas to disable certain warnings for MSVC:

#ifdef _MSC_VER

Maybe try adding a similar pragma to silence the warning you're seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants