src/types.h

changeset 273
0a9141118630
parent 272
2074672a6554
child 274
d232fe4d88a6
equal deleted inserted replaced
272:2074672a6554 273:0a9141118630
255 255
256 void sort () { 256 void sort () {
257 std::sort (begin (), end ()); 257 std::sort (begin (), end ());
258 } 258 }
259 259
260 ulong find (const T& needle) {
261 ulong i = 0;
262 for (const T& hay : *this) {
263 if (hay == needle)
264 return i;
265
266 i++;
267 }
268
269 return -1u;
270 }
271
260 private: 272 private:
261 std::vector<T> m_vect; 273 std::vector<T> m_vect;
262 }; 274 };
263 275
264 template<class T> class VectorReverser { 276 template<class T> class VectorReverser {

mercurial