proxygen
ForEach< ValueType > Class Template Reference

Public Member Functions

template<typename InputIterator >
 ForEach (InputIterator begin, InputIterator end)
 
void operator() (FunctionRef< void(ValueType)> f) const
 

Private Attributes

Function< void(FunctionRef< void(ValueType)>) const > const func_
 

Detailed Description

template<typename ValueType>
class ForEach< ValueType >

Definition at line 198 of file FunctionRefTest.cpp.

Constructor & Destructor Documentation

template<typename ValueType >
template<typename InputIterator >
ForEach< ValueType >::ForEach ( InputIterator  begin,
InputIterator  end 
)
inline

Definition at line 201 of file FunctionRefTest.cpp.

References folly::test::end(), and f.

202  : func_([begin, end](FunctionRef<void(ValueType)> f) {
203  for (auto it = begin; it != end; ++it) {
204  f(*it);
205  }
206  }) {}
auto f
A reference wrapper for callable objects.
Definition: Function.h:893
auto begin(TestAdlIterable &instance)
Definition: ForeachTest.cpp:56
Function< void(FunctionRef< void(ValueType)>) const > const func_
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62

Member Function Documentation

template<typename ValueType >
void ForEach< ValueType >::operator() ( FunctionRef< void(ValueType)>  f) const
inline

Definition at line 208 of file FunctionRefTest.cpp.

References f.

208  {
209  func_(f);
210  }
Function< void(FunctionRef< void(ValueType)>) const > const func_

Member Data Documentation

template<typename ValueType >
Function<void(FunctionRef<void(ValueType)>) const> const ForEach< ValueType >::func_
private

Definition at line 213 of file FunctionRefTest.cpp.


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