mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpimath] Increase constexpr support in geometry data types (#4231)
This uses std::is_constant_evaluated() to conditionally use the gcem library for constexpr calculations.
This commit is contained in:
@@ -60,7 +60,7 @@ struct WPILIB_DLLEXPORT Twist2d {
|
||||
* @param factor The factor by which to scale.
|
||||
* @return The scaled Twist2d.
|
||||
*/
|
||||
Twist2d operator*(double factor) const {
|
||||
constexpr Twist2d operator*(double factor) const {
|
||||
return Twist2d{dx * factor, dy * factor, dtheta * factor};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user