From 1f03052e0c3a8bab0b04a4817ef9947faf927bba Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Fri, 2 Mar 2012 23:11:33 +0000 Subject: [PATCH] Fixed comparison of Key with Symbol (had ambiguous overload) --- gtsam/nonlinear/Symbol.h | 6 ++++++ 1 file changed, 6 insertions(+) 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