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 { |