RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.35k stars 1.27k forks source link

[multibody] Remove dynamic_cast from private inline functions #22208

Open jwnimmer-tri opened 4 days ago

jwnimmer-tri commented 4 days ago

The dynamic_cast operation does not meet our styleguide requirements for being inline. We either need to get rid of the cast (by simplifying the function), or move its definition to the cc file.

This change is tangentially inspired by https://github.com/RobotLocomotion/drake/issues/22204.

(Technically the GetParentPlant is a public function so the commit subject isn't quite right, but anyway it seems reasonable to change it here, too, since its fix shares a mechanism within this cohort.)


This change is Reviewable

jwnimmer-tri commented 3 days ago

+@amcastro-tri for a quick feature reviewer sanity-check from the MbT developer team, please.

+@rpoyner-tri for platform review per schedule (tomorrow), please.