diff --git a/gtsam/nonlinear/Values-inl.h b/gtsam/nonlinear/Values-inl.h index a31e100ef..40e95188e 100644 --- a/gtsam/nonlinear/Values-inl.h +++ b/gtsam/nonlinear/Values-inl.h @@ -40,31 +40,6 @@ namespace gtsam { ValueCloneAllocator() {} }; -#if 0 - /* ************************************************************************* */ - class ValueAutomaticCasting { - Key key_; - const Value& value_; - - public: - ValueAutomaticCasting(Key key, const Value& value) : key_(key), value_(value) {} - - template - class ConvertibleToValue : public ValueType { - }; - - template - operator const ConvertibleToValue& () const { - // Check the type and throw exception if incorrect - if(typeid(ValueType) != typeid(value_)) - throw ValuesIncorrectType(key_, typeid(ValueType), typeid(value_)); - - // We have already checked the type, so do a "blind" static_cast, not dynamic_cast - return static_cast&>(value_); - } - }; -#endif - /* ************************************************************************* */ template const ValueType& Values::at(Key j) const { @@ -83,27 +58,6 @@ namespace gtsam { return static_cast(*item->second); } -#if 0 - /* ************************************************************************* */ - inline ValueAutomaticCasting Values::at(Key j) const { - // Find the item - KeyValueMap::const_iterator item = values_.find(j); - - // Throw exception if it does not exist - if(item == values_.end()) - throw ValuesKeyDoesNotExist("retrieve", j); - - return ValueAutomaticCasting(item->first, *item->second); - } -#endif - -#if 0 - /* ************************************************************************* */ - inline ValueAutomaticCasting Values::operator[](Key j) const { - return at(j); - } -#endif - /* ************************************************************************* */ template boost::optional Values::exists(Key j) const {