diff --git a/OpenSim/Simulation/Control/ControlLinearNode.cpp b/OpenSim/Simulation/Control/ControlLinearNode.cpp index 9f6a701a47..e04d0187c8 100644 --- a/OpenSim/Simulation/Control/ControlLinearNode.cpp +++ b/OpenSim/Simulation/Control/ControlLinearNode.cpp @@ -141,10 +141,11 @@ operator=(const ControlLinearNode &aNode) * @return True if the times are equal, false otherwise. */ bool ControlLinearNode:: -operator==(const ControlLinearNode &aNode) const +operator==(const Object &aNode) const { - if((_t) > aNode._t) return(false); - if((_t) < aNode._t) return(false); + const auto& node = dynamic_cast(aNode); + if((_t) > node._t) return(false); + if((_t) < node._t) return(false); return(true); } @@ -159,9 +160,10 @@ operator==(const ControlLinearNode &aNode) const * @return True if the time of this node is less than the time of aNode. */ bool ControlLinearNode:: -operator<(const ControlLinearNode &aNode) const +operator<(const Object &aNode) const { - if(_t(aNode); + if(node._t) return(true); else return(false); } diff --git a/OpenSim/Simulation/Control/ControlLinearNode.h b/OpenSim/Simulation/Control/ControlLinearNode.h index 117ddff650..5cc8eb6313 100644 --- a/OpenSim/Simulation/Control/ControlLinearNode.h +++ b/OpenSim/Simulation/Control/ControlLinearNode.h @@ -92,8 +92,8 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ControlLinearNode, Object); public: #ifndef SWIG ControlLinearNode& operator=(const ControlLinearNode &aControl); - bool operator==(const ControlLinearNode &aControl) const; - bool operator<(const ControlLinearNode &aControl) const; + bool operator==(const Object &aControl) const override; + bool operator<(const Object &aControl) const override; friend std::ostream& operator<<(std::ostream &aOut, const ControlLinearNode &aControlLinearNode);