Changeset 94:a4688e4138ec in lemon-main for lemon/concepts
- Timestamp:
- 03/18/08 13:57:15 (17 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/concepts/maps.h
r79 r94 48 48 49 49 /// Returns the value associated with the given key. 50 51 /// Returns the value associated with the given key. 52 /// \bug Value shouldn't need to be default constructible. 53 Value operator[](const Key &) const { return Value(); } 50 Value operator[](const Key &) const { 51 return *static_cast<Value *>(0); 52 } 54 53 55 54 template<typename _ReadMap> … … 127 126 128 127 /// Returns the value associated with the given key. 129 Value operator[](const Key &) const { return Value(); } 128 Value operator[](const Key &) const { 129 return *static_cast<Value *>(0); 130 } 130 131 131 132 /// Sets the value associated with the given key. … … 161 162 typedef CR ConstReference; 162 163 163 protected:164 Value tmp;165 164 public: 166 165 167 166 /// Returns a reference to the value associated with the given key. 168 Reference operator[](const Key &) { return tmp; } 167 Reference operator[](const Key &) { 168 return *static_cast<Value *>(0); 169 } 169 170 170 171 /// Returns a const reference to the value associated with the given key. 171 ConstReference operator[](const Key &) const { return tmp; } 172 ConstReference operator[](const Key &) const { 173 return *static_cast<Value *>(0); 174 } 172 175 173 176 /// Sets the value associated with the given key.
Note: See TracChangeset
for help on using the changeset viewer.