MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / each_sum

Method each_sum

StereoKitC/libraries/array.h:157–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 U each_with (void (*e)(U *, const T &)) const { U result = {}; for (int32_t i = 0; i < count; i++) e(&result, data[i]); }
156 template <typename U>
157 U each_sum (U (*e)(const T &)) const { U result = 0; for (int32_t i = 0; i < count; i++) result += e(data[i]); return result; }
158 template <typename U>
159 array_t<U> each_new (U (*e)(const T &)) const { array_t<U> result = {}; result.resize(count); for (int32_t i=0; i<count; i++) result.add(e(data[i])); return result; }
160 void free ();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected