wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.04k stars 605 forks source link

Modify C++ `LinearFilter::Reset(span<double>, span<double>)` to take `span<T>` #6628

Closed bhall-ctre closed 2 months ago

bhall-ctre commented 2 months ago

Previously, the two-parameter LinearFilter::Reset overload took span<double> parameters. However, m_inputs and m_outputs store T, so for any T that does not have an implicit constructor from double (such as the units library), the two-parameter Reset function is not usable.

The two possible solutions are to add an explicit T() in the push_back calls, or fix the overload to take span<T>. This PR does the latter.