proxygen
folly::gen::detail::Map< Predicate > Class Template Reference

#include <Base-inl.h>

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

Classes

class  Generator
 

Public Member Functions

 Map ()=default
 
 Map (Predicate pred)
 
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen compose (GenImpl< Value, Source > &&source) const
 
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Map< Predicate > >
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

Predicate pred_
 

Additional Inherited Members

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

Detailed Description

template<class Predicate>
class folly::gen::detail::Map< Predicate >

Map - For producing a sequence of values by passing each value from a source collection through a predicate.

This type is usually used through the 'map' or 'mapped' helper function:

auto squares = seq(1, 10) | map(square) | as<std::vector>();

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

Constructor & Destructor Documentation

template<class Predicate>
folly::gen::detail::Map< Predicate >::Map ( )
default
template<class Predicate>
folly::gen::detail::Map< Predicate >::Map ( Predicate  pred)
inlineexplicit

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

References type, and testing::Value().

516 : pred_(std::move(pred)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

template<class Predicate>
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Map< Predicate >::compose ( GenImpl< Value, Source > &&  source) const
inline

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

References folly::gen::move.

548  {
549  return Gen(std::move(source.self()), pred_);
550  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<class Predicate>
template<class Source , class Value , class Gen = Generator<Value, Source>>
Gen folly::gen::detail::Map< Predicate >::compose ( const GenImpl< Value, Source > &  source) const
inline

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

References folly::gen::FBounded< Self >::self().

553  {
554  return Gen(source.self(), pred_);
555  }

Member Data Documentation

template<class Predicate>
Predicate folly::gen::detail::Map< Predicate >::pred_
private

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


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