proxygen
|
#include <Base-inl.h>
Public Member Functions | |
FoldLeft ()=default | |
FoldLeft (Seed seed, Fold fold) | |
template<class Source , class Value > | |
Seed | compose (const GenImpl< Value, Source > &source) const |
Public Member Functions inherited from folly::gen::Operator< FoldLeft< Seed, Fold > > | |
ResultGen | compose (const GenImpl< Value, Source > &source) const |
Public Member Functions inherited from folly::gen::FBounded< Self > | |
const Self & | self () const |
Self & | self () |
Private Attributes | |
Seed | seed_ |
Fold | fold_ |
Additional Inherited Members | |
Protected Member Functions inherited from folly::gen::Operator< FoldLeft< Seed, Fold > > | |
Operator ()=default | |
Operator (Operator &&) noexcept=default | |
Operator (const Operator &)=default | |
Operator & | operator= (Operator &&) noexcept=default |
Operator & | operator= (const Operator &)=default |
FoldLeft - Left-associative functional fold. For producing an aggregate value from a seed and a folder function. Useful for custom aggregators on a sequence.
This type is primarily used through the 'foldl' helper method, like:
double movingAverage = from(values) | foldl(0.0, [](double avg, double sample) { return sample * 0.1 + avg * 0.9; });
Definition at line 2004 of file Base-inl.h.
|
default |
|
inline |
Definition at line 2010 of file Base-inl.h.
|
inline |
Definition at line 2014 of file Base-inl.h.
References folly::gen::move, v, and testing::Value().
|
private |
Definition at line 2006 of file Base-inl.h.
|
private |
Definition at line 2005 of file Base-inl.h.