diff --git a/gtsam_unstable/geometry/SimWall2D.cpp b/gtsam_unstable/geometry/SimWall2D.cpp index 3fb96ad0b..cd52b9696 100644 --- a/gtsam_unstable/geometry/SimWall2D.cpp +++ b/gtsam_unstable/geometry/SimWall2D.cpp @@ -25,7 +25,7 @@ bool SimWall2D::equals(const SimWall2D& other, double tol) const { } /* ************************************************************************* */ -bool SimWall2D::intersects(const SimWall2D& B, boost::optional pt) const { +bool SimWall2D::intersects(const SimWall2D& B, Point2* pt) const { const bool debug = false; const SimWall2D& A = *this; diff --git a/gtsam_unstable/geometry/SimWall2D.h b/gtsam_unstable/geometry/SimWall2D.h index fd5afbc54..4274300df 100644 --- a/gtsam_unstable/geometry/SimWall2D.h +++ b/gtsam_unstable/geometry/SimWall2D.h @@ -51,7 +51,15 @@ namespace gtsam { * returns true if they intersect, with the intersection * point in the optional second argument */ - bool intersects(const SimWall2D& wall, boost::optional pt=boost::none) const; + bool intersects(const SimWall2D& wall, Point2* pt = nullptr) const; + + /** + * An overload of intersects that takes an l-value reference to a Point2 + * instead of a pointer. + */ + bool intersects(const SimWall2D& wall, Point2& pt) const { + return intersects(wall, &pt); + } /** * norm is a 2D point representing the norm of the wall