proxygen
folly::gen::detail::Contains< Needle > Class Template Reference

#include <Base-inl.h>

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

Public Member Functions

 Contains (Needle needle)
 
template<class Source , class Value , class StorageType = typename std::decay<Value>::type>
bool compose (const GenImpl< Value, Source > &source) const
 
- Public Member Functions inherited from folly::gen::Operator< Contains< Needle > >
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

Needle needle_
 

Additional Inherited Members

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

Detailed Description

template<class Needle>
class folly::gen::detail::Contains< Needle >

Contains - For testing whether a value matching the given value is contained in a sequence.

This type should be used through the 'contains' helper method, like:

bool contained = seq(1, 10) | map(square) | contains(49);

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

Constructor & Destructor Documentation

template<class Needle >
folly::gen::detail::Contains< Needle >::Contains ( Needle  needle)
inlineexplicit

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

References type, and testing::Value().

2183 : needle_(std::move(needle)) {}
const string needle
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

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

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

References value.

2189  {
2190  static_assert(
2191  !Source::infinite,
2192  "Calling contains on an infinite source might cause "
2193  "an infinite loop.");
2194  return !(source | [this](Value value) {
2195  return !(needle_ == std::forward<Value>(value));
2196  });
2197  }
bool Value(const T &value, M matcher)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)

Member Data Documentation

template<class Needle >
Needle folly::gen::detail::Contains< Needle >::needle_
private

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


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