Repository navigation
Conversation
Remove the unused, non-deducible third template parameter from the default-precision overload. Add regression coverage for strict, equal, approximate, and false comparisons in the existing misc test target.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The two-argument
almost_le(x, y)overload declares three template type parameters even though only two appear in its function arguments.T3can therefore never be deduced, so ordinary calls to this public helper fail at compile time. The neighboringalmost_ge(x, y)overload already uses the intended two-parameter form.This removes the unused
T3from only the default-precision overload. The explicit three-argument overload remains unchanged, so its caller-selected precision behavior is preserved.Regression coverage
A new test is added to the existing
ocs2_core_test_misctarget. It exercises strict less-than, equality, a one-ULP approximate comparison in the reverse direction, and a clearly greater value. Keeping the test while reverting the production change makes all four calls fail to compile withcouldn't infer template argument 'T3'; with the fix, the test compiles and all four assertions pass.Validation
testNumerics.cppgit diff --checkThe local macOS environment does not provide the ROS 1/catkin toolchain needed for the complete project build, so the repository's Ubuntu CI will provide the full integration check.
Fixes #72.