MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / zipWith

Function zipWith

source/core/StarAlgorithm.hpp:309–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308template <typename OutputContainer, typename Function, typename Container1, typename Container2>
309OutputContainer zipWith(Function&& function, Container1 const& cont1, Container2 const& cont2) {
310 auto it1 = cont1.begin();
311 auto it2 = cont2.begin();
312
313 OutputContainer out;
314 while (it1 != cont1.end() && it2 != cont2.end()) {
315 out.insert(out.end(), function(*it1, *it2));
316 ++it1;
317 ++it2;
318 }
319
320 return out;
321}
322
323// Moves the given value and into an rvalue. Works whether or not the type has
324// a valid move constructor or not. Always leaves the given value in its

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected