C++ has std::reduce for that, which is std::accumulate except it's defined to operate without any specific ordering.
And now you should probably also stop and consider whether adding elements one-by-one as opposed to recursively adding together sums of smaller subarrays has better or worse numerical behaviour in regards to e.g. rounding and stability.
Thanks everyone, my C++ knowledge has been greatly expanded today.