| 163 | /// Similiar to std::for_each but instead pass adjacent pairs to the function |
| 164 | template <class Iterator, class F> |
| 165 | Iterator adjacent_for_each(Iterator first, Iterator last, F f) |
| 166 | { |
| 167 | if(first == last) |
| 168 | return last; |
| 169 | |
| 170 | Iterator next = first; |
| 171 | ++next; |
| 172 | |
| 173 | for(; next != last; ++next, ++first) |
| 174 | f(*first, *next); |
| 175 | |
| 176 | return last; |
| 177 | } |
| 178 | |
| 179 | /// Like std::for_each but can pass in another range like std::transform |
| 180 | template <class Iterator1, class Iterator2, class F> |
no outgoing calls
no test coverage detected