weixin_39640090 2020-11-29 15:05
浏览 0

Add operator overloading for symbolic::Variable

This is for https://github.com/RobotLocomotion/drake/issues/4619. We need operator overloading +, -, *, / between symbolic::Variables. For example,

c++
symbolic::Expression operator+(symbolic::Variable& lhs, symbolic::Variable& rhs)

该提问来源于开源项目:RobotLocomotion/drake

  • 写回答

3条回答 默认 最新

  • weixin_39640090 2020-11-29 15:05
    关注

    -tri , an easy way to achieve this is to make the following constructor non-explicit:

    c++
    /** Constructs a variable. */
    explicit Expression(const Variable& var);
    

    Will that be fine?

    评论

报告相同问题?