proxygen
folly::gen::detail::Collect< Collection > Class Template Reference

#include <Base-inl.h>

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

Public Member Functions

 Collect ()=default
 
template<class Value , class Source , class StorageType = typename std::decay<Value>::type>
Collection compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Collect< Collection > >
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< Collect< Collection > >
 Operator ()=default
 
 Operator (Operator &&) noexcept=default
 
 Operator (const Operator &)=default
 
Operatoroperator= (Operator &&) noexcept=default
 
Operatoroperator= (const Operator &)=default
 

Detailed Description

template<class Collection>
class folly::gen::detail::Collect< Collection >

Collect - For collecting values from a source in a collection of the desired type.

This type is usually used through the helper function 'as', like:

std::string upper = from(stringPiece) | map(&toupper) | as<std::string>();

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

Constructor & Destructor Documentation

template<class Collection >
folly::gen::detail::Collect< Collection >::Collect ( )
default

Member Function Documentation

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

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

References v, and testing::Value().

2302  {
2303  static_assert(
2304  !Source::infinite, "Cannot convert infinite source to object with as.");
2305  Collection collection;
2306  source | [&](Value v) {
2307  collection.insert(collection.end(), std::forward<Value>(v));
2308  };
2309  return collection;
2310  }
auto v
bool Value(const T &value, M matcher)

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