diff --git a/include/hpp/manipulation/container.hh b/include/hpp/manipulation/container.hh index 0036d1c81f241db3ca0ab1d61d4071a6c46ba406..d9d8b5f0d8882285b4524b93497e9670fc0e177c 100644 --- a/include/hpp/manipulation/container.hh +++ b/include/hpp/manipulation/container.hh @@ -39,7 +39,7 @@ namespace hpp { const Element& get (const Key& name) const { typename ElementMap_t::const_iterator it = map_.find (name); - if (it == map_.end ()) return Element (); + if (it == map_.end ()) return default_; return it->second; } @@ -78,6 +78,8 @@ namespace hpp { private: ElementMap_t map_; + /// Element returned by method get when key does not belong to map. + Element default_; }; // class Container } // namespace manipulation } // namespace hpp