proxygen
folly::gen::detail::First Class Reference

#include <Base-inl.h>

Inheritance diagram for folly::gen::detail::First:
folly::gen::Operator< First > folly::gen::FBounded< Self >

Public Member Functions

 First ()=default
 
template<class Source , class Value , class StorageType = typename std::decay<Value>::type>
Optional< StorageType > compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< First >
ResultGen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::FBounded< Self >
const Self & self () const
 
Self & self ()
 

Additional Inherited Members

- Protected Member Functions inherited from folly::gen::Operator< First >
 Operator ()=default
 
 Operator (Operator &&) noexcept=default
 
 Operator (const Operator &)=default
 
Operatoroperator= (Operator &&) noexcept=default
 
Operatoroperator= (const Operator &)=default
 

Detailed Description

First - For finding the first value in a sequence.

This type is primarily used through the 'first' static value, like:

int firstThreeDigitPrime = seq(100) | filter(isPrime) | first;

Definition at line 2031 of file Base-inl.h.

Constructor & Destructor Documentation

folly::gen::detail::First::First ( )
default

Member Function Documentation

template<class Source , class Value , class StorageType = typename std::decay<Value>::type>
Optional<StorageType> folly::gen::detail::First::compose ( const GenImpl< Value, Source > &  source) const
inline

Definition at line 2039 of file Base-inl.h.

References v.

Referenced by folly::gen::detail::Composed< First, Second >::compose().

2039  {
2040  Optional<StorageType> accum;
2041  source | [&](Value v) -> bool {
2042  accum = std::forward<Value>(v);
2043  return false;
2044  };
2045  return accum;
2046  }
auto v
bool Value(const T &value, M matcher)

The documentation for this class was generated from the following file: