Changeset 1211:a278d16bd2d0 in lemon-main
- Timestamp:
- 07/29/20 14:56:10 (4 years ago)
- Branch:
- default
- Phase:
- public
- Tags:
- tip
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/concepts/maps.h
r1092 r1211 50 50 /// Returns the value associated with the given key. 51 51 Value operator[](const Key &) const { 52 return *(static_cast<Value *>(0)+1); 52 // return *(static_cast<Value *>(0)); 53 // return *(static_cast<Value *>(0)+1); 54 // return *(static_cast<Value *>(sizeof(Value))); 55 // return *(reinterpret_cast<Value *>(0)); 56 // return *(reinterpret_cast<Value *>(0)+1); 57 return *(reinterpret_cast<Value *>(sizeof(Value))); 53 58 } 54 59 … … 132 137 /// Returns the value associated with the given key. 133 138 Value operator[](const Key &) const { 134 Value *r = 0; 135 return *r; 139 return *(reinterpret_cast<Value *>(sizeof(Value))); 136 140 } 137 141 … … 173 177 /// Returns a reference to the value associated with the given key. 174 178 Reference operator[](const Key &) { 175 Value *r = 0; 176 return *r; 179 return *(reinterpret_cast<Value *>(sizeof(Value))); 177 180 } 178 181 179 182 /// Returns a const reference to the value associated with the given key. 180 183 ConstReference operator[](const Key &) const { 181 Value *r = 0; 182 return *r; 184 return *(reinterpret_cast<Value *>(sizeof(Value))); 183 185 } 184 186
Note: See TracChangeset
for help on using the changeset viewer.