From 04bcf26aa6314408f93e95325950597e23e4a428 Mon Sep 17 00:00:00 2001 From: cbeall3 Date: Tue, 20 Oct 2015 14:44:00 -0400 Subject: [PATCH] Explicitly cast optional to bool --- gtsam/slam/SmartProjectionFactor.h | 2 +- gtsam_unstable/slam/SmartStereoProjectionFactor.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/slam/SmartProjectionFactor.h b/gtsam/slam/SmartProjectionFactor.h index 5146c5a32..13a4dd38f 100644 --- a/gtsam/slam/SmartProjectionFactor.h +++ b/gtsam/slam/SmartProjectionFactor.h @@ -246,7 +246,7 @@ public: /// triangulate bool triangulateForLinearize(const Cameras& cameras) const { triangulateSafe(cameras); // imperative, might reset result_ - return (result_); + return bool(result_); } /// linearize returns a Hessianfactor that is an approximation of error(p) diff --git a/gtsam_unstable/slam/SmartStereoProjectionFactor.h b/gtsam_unstable/slam/SmartStereoProjectionFactor.h index e7118a36c..6651c005f 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionFactor.h @@ -314,7 +314,7 @@ public: /// triangulate bool triangulateForLinearize(const Cameras& cameras) const { triangulateSafe(cameras); // imperative, might reset result_ - return (result_); + return bool(result_); } /// linearize returns a Hessianfactor that is an approximation of error(p) @@ -583,7 +583,7 @@ public: /// Is result valid? bool isValid() const { - return result_; + return bool(result_); } /** return the degenerate state */