From 2a3eabc4bf6d02633831ea53673f2cf66b37e77a Mon Sep 17 00:00:00 2001 From: yao Date: Mon, 6 Jun 2016 09:07:18 -0400 Subject: [PATCH 1/3] Added one explicit assigment operator since the member data are qualified as const. --- gtsam/inference/Symbol.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtsam/inference/Symbol.h b/gtsam/inference/Symbol.h index 102761273..1d71ea3a6 100644 --- a/gtsam/inference/Symbol.h +++ b/gtsam/inference/Symbol.h @@ -106,6 +106,15 @@ public: return comp != (Key)(*this); } + /** Explicit assignment */ + Symbol& operator=(const Symbol& symbol2) { + if (&symbol2 != this) { + (unsigned char&) c_ = symbol2.c_; + (std::uint64_t&) j_ = symbol2.j_; + } + return *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 * Values::filter() function to retrieve all key-value pairs with the From 2264678c652780d903fb71db517498c34a4aca02 Mon Sep 17 00:00:00 2001 From: yao Date: Mon, 6 Jun 2016 13:32:36 -0400 Subject: [PATCH 2/3] Removed the const qualifier in the delarations of data members and removed the explicit assignment operator. --- gtsam/inference/Symbol.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gtsam/inference/Symbol.h b/gtsam/inference/Symbol.h index 1d71ea3a6..bd04efc24 100644 --- a/gtsam/inference/Symbol.h +++ b/gtsam/inference/Symbol.h @@ -33,8 +33,8 @@ namespace gtsam { */ class GTSAM_EXPORT Symbol { protected: - const unsigned char c_; - const std::uint64_t j_; + unsigned char c_; + std::uint64_t j_; public: @@ -106,14 +106,6 @@ public: return comp != (Key)(*this); } - /** Explicit assignment */ - Symbol& operator=(const Symbol& symbol2) { - if (&symbol2 != this) { - (unsigned char&) c_ = symbol2.c_; - (std::uint64_t&) j_ = symbol2.j_; - } - return *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 From f6de41e0ffb992a3232b0b2d97e12498efddb17c Mon Sep 17 00:00:00 2001 From: yao Date: Mon, 6 Jun 2016 13:33:30 -0400 Subject: [PATCH 3/3] Deleted one blank line --- gtsam/inference/Symbol.h | 1 - 1 file changed, 1 deletion(-) diff --git a/gtsam/inference/Symbol.h b/gtsam/inference/Symbol.h index bd04efc24..2d7ede8e7 100644 --- a/gtsam/inference/Symbol.h +++ b/gtsam/inference/Symbol.h @@ -106,7 +106,6 @@ public: 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 * Values::filter() function to retrieve all key-value pairs with the