# Cumulative Aggregate C++ Sequence Methods

> All Cumulative Aggregate C++ Sequence methods produce a result sequence which is of the same type as the object's sequence or of type `double` depending on the operation performed. The value of each element is the result of the specified operation on all of the preceding elements.

> Sequence<T> cumAggMax() const | Returns a sequence of the same type with the cumulative maximum: each element is the maximum value of all the preceding elements
> Sequence<T> cumAggMin() const | Returns a sequence of the same type with the cumulative minimum: each element is the minimum value of all the preceding elements
> Sequence<R> cumAggSum() const | Returns a sequence of the same type with the cumulative sum: each element is the sum of all the preceding elements
> Sequence<R> cumAggPrd() const | Returns a sequence of the same type with the cumulative product: each element is the product of all the preceding elements
> Sequence<double> cumAggAvg() const | Returns a `double` sequence with the cumulative average: each element is the average of all the preceding elements
> Sequence<double> cumAggVar() const | Returns a `double` sequence with the cumulative variance: each element is the variance of all the preceding elements
> Sequence<double> cumAggVarSamp() const | Returns a `double` sequence with the cumulative sample variance: each element is the cumulative sample variance of all the preceding elements
> Sequence<double> cumAggDev() const | Returns a `double` sequence with the cumulative standard deviation: each element is the cumulative standard deviation of all the preceding elements
> Sequence<double> cumAggDevSamp() const | Returns a `double` sequence with the sample standard deviation: each element is the cumulative sample standard deviation of all the preceding elements

> ## Example

> Following is an example code snippet demonstrating a cumulative aggregate function:

>             Sequence<float> close = quote.close_iterator();
>             double cumAvg = close.cumAggAvg()
>             ...