diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index 4bc5f0f7e..03bafaf3e 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -37,16 +37,16 @@ #include #include #include -#include #include #include namespace gtsam { - // Forward declarations + // Forward declarations / utilities class ValueCloneAllocator; class ValueAutomaticCasting; + template static bool _truePredicate(const T&) { return true; } /** * A non-templated config holding any types of Manifold-group elements. A @@ -300,7 +300,7 @@ namespace gtsam { */ template Filtered - filter(const boost::function& filterFcn = (boost::lambda::_1, true)); + filter(const boost::function& filterFcn = &_truePredicate); /** * Return a filtered view of this Values class, without copying any data. @@ -338,7 +338,7 @@ namespace gtsam { */ template ConstFiltered - filter(const boost::function& filterFcn = (boost::lambda::_1, true)) const; + filter(const boost::function& filterFcn = _truePredicate()) const; private: // Filters based on ValueType (if not Value) and also based on the user- @@ -380,13 +380,13 @@ namespace gtsam { mutable std::string message_; public: - /// Construct with the key-value pair attemped to be added + /// Construct with the key-value pair attempted to be added ValuesKeyAlreadyExists(Key key) throw() : key_(key) {} virtual ~ValuesKeyAlreadyExists() throw() {} - /// The duplicate key that was attemped to be added + /// The duplicate key that was attempted to be added Key key() const throw() { return key_; } /// The message to be displayed to the user