MCPcopy Create free account
hub / github.com/comaps/comaps / ForEach

Method ForEach

libs/base/base_tests/control_flow_tests.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15 template <typename Fn>
16 void ForEach(Fn && fn)
17 {
18 ControlFlowWrapper<Fn> wrapper(std::forward<Fn>(fn));
19 for (uint32_t i = 0; i < m_repetitions; ++i)
20 {
21 ++m_calls;
22 if (wrapper() == ControlFlow::Break)
23 return;
24 }
25 }
26
27 uint32_t m_repetitions = 0;
28 uint32_t m_calls = 0;

Callers 2

UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45

Calls 1

wrapperFunction · 0.50

Tested by

no test coverage detected