DMA & InlineToMemory Engines Rework.

This commit is contained in:
bunnei 2022-08-14 02:36:36 -07:00 committed by Fernando Sahmkow
parent b2099fbdcc
commit f5fd6b5c86
21 changed files with 323 additions and 242 deletions

View file

@ -24,4 +24,12 @@ template <class ForwardIt, class T, class Compare = std::less<>>
return first != last && !comp(value, *first) ? first : last;
}
template <typename T, typename Func, typename... Args>
T FoldRight(T initial_value, Func&& func, Args&&... args) {
T value{initial_value};
const auto high_func = [&value, &func]<typename T>(T x) { value = func(value, x); };
(std::invoke(high_func, std::forward<Args>(args)), ...);
return value;
}
} // namespace Common