Changeset 6d8a63a in mainline
- Timestamp:
- 2018-07-05T21:41:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de53138
- Parents:
- f9ce7cd
- git-author:
- Dzejrou <dzejrou@…> (2018-04-17 20:16:52)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/deque.hpp
rf9ce7cd r6d8a63a 1146 1146 bool operator==(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1147 1147 { 1148 // TODO: implement 1149 return false; 1148 if (lhs.size() != rhs.size()) 1149 return false; 1150 1151 for (decltype(lhs.size()) i = 0; i < lhs.size(); ++i) 1152 { 1153 if (lhs[i] != rhs[i]) 1154 return false; 1155 } 1156 1157 return true; 1150 1158 } 1151 1159 … … 1153 1161 bool operator<(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1154 1162 { 1155 // TODO: implement 1156 return false; 1163 auto min_size = min(lhs.size(), rhs.size()); 1164 for (decltype(lhs.size()) i = 0; i < min_size; ++i) 1165 { 1166 if (lhs[i] >= rhs[i]) 1167 return false; 1168 } 1169 1170 if (lhs.size() == rhs.size()) 1171 return true; 1172 else 1173 return lhs.size() < rhs.size(); 1157 1174 } 1158 1175 … … 1160 1177 bool operator!=(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1161 1178 { 1162 // TODO: implement 1163 return false; 1179 return !(lhs == rhs); 1164 1180 } 1165 1181 … … 1167 1183 bool operator>(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1168 1184 { 1169 // TODO: implement 1170 return false; 1185 return rhs < lhs; 1171 1186 } 1172 1187 … … 1174 1189 bool operator<=(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1175 1190 { 1176 // TODO: implement 1177 return false; 1191 return !(rhs < lhs); 1178 1192 } 1179 1193 … … 1181 1195 bool operator>=(const deque<T, Allocator>& lhs, const deque<T, Allocator>& rhs) 1182 1196 { 1183 // TODO: implement 1184 return false; 1197 return !(lhs < rhs); 1185 1198 } 1186 1199
Note:
See TracChangeset
for help on using the changeset viewer.