[#absl-c_accumulate-0a]
= xref:absl.adoc[absl]::c&lowbar;accumulate
:relfileprefix: ../
:mrdocs:

Container&hyphen;based version of the &lt;numeric&gt; `std&colon;&colon;accumulate()` function to accumulate the element values of a container to `init` and return that accumulation by value&period;

== Synopsis

Declared in `&lt;absl&sol;algorithm&sol;container&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Sequence,
    typename T&gt;
constexpr
std::decay&lowbar;t&lt;T&gt;
c&lowbar;accumulate(
    Sequence const& sequence,
    T&& init);
----

== Description

Note&colon; Due to a language technicality this function has return type std&colon;&colon;decay&lowbar;t&lt;T&gt;&period; As a user of this function you can casually read this as &quot;returns T by value&quot; and assume it does the right thing&period;

== Return Value

The accumulated result&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sequence*
| The container whose elements to accumulate&period;
| *init*
| The initial value of the accumulation&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
