diff --git a/gtsam/nonlinear/Symbol.h b/gtsam/nonlinear/Symbol.h index 945044492..18b5157bb 100644 --- a/gtsam/nonlinear/Symbol.h +++ b/gtsam/nonlinear/Symbol.h @@ -113,9 +113,15 @@ public: bool operator==(const Symbol& comp) const { return comp.c_ == c_ && comp.j_ == j_; } + bool operator==(Key comp) const { + return comp == (Key)(*this); + } bool operator!=(const Symbol& comp) const { return comp.c_ != c_ || comp.j_ != j_; } + bool operator!=(Key comp) const { + return comp != (Key)(*this); + } /** Return a filter function that returns true when evaluated on a Key whose * character (when converted to a Symbol) matches \c c. Use this with the