| 12345678910111213141516171819 |
- //
- // for_each_test.cxx
- // stream-test
- //
- // Created by Sam Jaffe on 4/6/23.
- //
- #include "stream/algorithm/for_each.h"
- #include "stream_helpers.h"
- #include "stream_matchers.h"
- TEST(ForEach, IteratesOverEachItem) {
- int hits = 0;
- ranges::for_each(std::vector<int>{1, 2, 3, 4, 5}, [&hits](int) { ++hits; });
- EXPECT_THAT(hits, 5);
- }
|