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

Document or fool-proof foot gun with getComponent(s) and query.next results #199

Open
Avokadoen opened this issue Oct 12, 2024 · 0 comments

Comments

@Avokadoen
Copy link
Owner

There is a very big footgun with getComponent(s).

Calling this function with pointer types is UB if followed by a setComponents that includes any of the pointer types in get.

The only way I can think of to eliminate this footgun would be to remove the ability to request pointers both in getComponent(s) and queries. The use would then have to call setComponents which probably will be slower and more verbose.

For documenting the footgun a entry in the readme and in the doc-comments for getComponent(s) and query.next

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

1 participant