[#absl-c_partial_sum-0c0]
= xref:absl.adoc[absl]::c&lowbar;partial&lowbar;sum
:relfileprefix: ../
:mrdocs:

`c&lowbar;partial&lowbar;sum` overloads

== Synopses

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

Container&hyphen;based version of the &lt;numeric&gt; `std&colon;&colon;partial&lowbar;sum()` function to compute the partial sum of the elements in a sequence and write them to an iterator&period; The partial sum is the sum of all element values so far in the sequence&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename InputSequence,
    typename OutputIt&gt;
constexpr
OutputIt
xref:absl/c_partial_sum-07.adoc[c&lowbar;partial&lowbar;sum](
    InputSequence const& input,
    OutputIt output&lowbar;first);
----

[.small]#xref:absl/c_partial_sum-07.adoc[_» more&period;&period;&period;_]#

Overload of `c&lowbar;partial&lowbar;sum()` for using a binary operation other than addition to compute the &quot;partial sum&quot;&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename InputSequence,
    typename OutputIt,
    typename BinaryOp&gt;
constexpr
OutputIt
xref:absl/c_partial_sum-0c7.adoc[c&lowbar;partial&lowbar;sum](
    InputSequence const& input,
    OutputIt output&lowbar;first,
    BinaryOp&& op);
----

[.small]#xref:absl/c_partial_sum-0c7.adoc[_» more&period;&period;&period;_]#

== Return Value

An iterator to the end of the written range in the output&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *input*
| The container whose elements to sum&period;
| *output&lowbar;first*
| The output iterator receiving the partial sums&period;
| *op*
| The binary operation used to combine values&period;
|===


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