-
Notifications
You must be signed in to change notification settings - Fork 653
[wpimath] Make Java take lists instead of Vectors where C++ takes wpi::arrays #7826
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
Comments
Doesn’t that require boxing? You can’t have a |
The |
Would it make sense for any of them to take primitive arrays instead? |
Depends on whether we like |
Just to help for comparison: // Vector
foo(VecBuilder.fill(1.0, 2.0, 3.0));
// List
foo(List.of(1.0, 2.0, 3.0));
// Array
foo(new double[] { 1.0, 2.0, 3.0 }); |
The second one is shortest and is likely more familiar due to it using a standard Java container, but knowing the correct import is still an issue ( |
A lot of wpimath Java APIs take a
Vector<N>
type, butVecBuilder.fill(...)
is more verbose thanList.of(...)
.The text was updated successfully, but these errors were encountered: