Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<bool writeout> double sumNumbers(const std::vector<double> &numbers, double *out_partialsums) {
- double total = 0.0;
- for (int i = 0; i < numbers.size(); i++) {
- total += numbers[i];
- /* ... */
- if (writeout) {
- out_partialsums[i] = total;
- }
- }
- return total;
- }
- auto result = sumNumbers<false>(numbers, NULL)
Add Comment
Please, Sign In to add comment