[#absl-c_accumulate-01] = xref:absl.adoc[absl]::c_accumulate :relfileprefix: ../ :mrdocs: `c_accumulate` overloads == Synopses Declared in `<absl/algorithm/container.h>` 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Sequence, typename T> constexpr std::decay_t<T> xref:absl/c_accumulate-0a.adoc[c_accumulate]( Sequence const& sequence, T&& init); ---- [.small]#xref:absl/c_accumulate-0a.adoc[_» more..._]# Overload of `c_accumulate()` for using a binary operations other than addition for computing the accumulation. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Sequence, typename T, typename BinaryOp> constexpr std::decay_t<T> xref:absl/c_accumulate-00.adoc[c_accumulate]( Sequence const& sequence, T&& init, BinaryOp&& binary_op); ---- [.small]#xref:absl/c_accumulate-00.adoc[_» more..._]# == 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. | *binary_op* | The binary operation used to combine values. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#