diff options
-rw-r--r-- | 001help.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/001help.cc b/001help.cc index 188862b0..a75657a8 100644 --- a/001help.cc +++ b/001help.cc @@ -220,8 +220,8 @@ template<typename T> typename T::mapped_type const& get(const T& map, typename T } template<typename T> typename T::mapped_type const& put(T& map, typename T::key_type const& key, typename T::mapped_type const& value) { // requires value to have a zero-arg (default) constructor - map[key] = value; - return map[key]; + (*((map.insert(std::make_pair(key, typename T::mapped_type()))).first)).second = value; + return (*((map.insert(std::make_pair(key, typename T::mapped_type()))).first)).second; } template<typename T> bool contains_key(T& map, typename T::key_type const& key) { return map.find(key) != map.end(); |