[#absl-c_accumulate-0a] = xref:absl.adoc[absl]::c_accumulate :relfileprefix: ../ :mrdocs: Container‐based version of the <numeric> `std::accumulate()` function to accumulate the element values of a container to `init` and return that accumulation by value. == Synopsis Declared in `<absl/algorithm/container.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Sequence, typename T> constexpr std::decay_t<T> c_accumulate( Sequence const& sequence, T&& init); ---- == Description Note: Due to a language technicality this function has return type std::decay_t<T>. As a user of this function you can casually read this as "returns T by value" and assume it does the right thing. == Return Value The accumulated result. == Parameters [cols="1,4"] |=== | Name| Description | *sequence* | The container whose elements to accumulate. | *init* | The initial value of the accumulation. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#