proxygen
folly::detail::partial::Partial< F, Tuple > Class Template Reference

#include <Partial.h>

Public Member Functions

template<typename Callable , typename... Args>
 Partial (PartialConstructFromCallable, Callable &&callable, Args &&...args)
 
template<typename... CArgs>
auto operator() (CArgs &&...cargs)&-> decltype(invokeForward(std::declval< Partial & >(), Indexes
 
 std::declval ()...))
 
template<typename... CArgs>
auto operator() (CArgs &&...cargs) const &-> decltype(invokeForward(std::declval< const Partial & >(), Indexes
 
 std::declval ()...))
 
template<typename... As>
auto operator() (As &&...a)&&-> decltype(invokeForward(std::declval< Partial && >(), Indexes
 
 std::declval ()...))
 
template<typename... As>
auto operator() (As &&...as) const &&-> decltype(invokeForward(std::declval< const Partial && >(), Indexes
 
 std::declval ()...))
 

Private Types

using Indexes = make_index_sequence< std::tuple_size< Tuple >{}>
 

Static Private Member Functions

template<typename Self , std::size_t... I, typename... Args>
static auto invokeForward (Self &&self, index_sequence< I... >, Args &&...args) -> decltype(invoke(std::declval< Self >().f_, std::get< I >(std::declval< Self >().stored_args_)..., std::declval< Args >()...))
 

Private Attributes

f_
 
Tuple stored_args_
 

Detailed Description

template<typename F, typename Tuple>
class folly::detail::partial::Partial< F, Tuple >

Definition at line 35 of file Partial.h.

Member Typedef Documentation

template<typename F , typename Tuple >
using folly::detail::partial::Partial< F, Tuple >::Indexes = make_index_sequence<std::tuple_size<Tuple>{}>
private

Definition at line 36 of file Partial.h.

Constructor & Destructor Documentation

template<typename F , typename Tuple >
template<typename Callable , typename... Args>
folly::detail::partial::Partial< F, Tuple >::Partial ( PartialConstructFromCallable  ,
Callable &&  callable,
Args &&...  args 
)
inline

Definition at line 52 of file Partial.h.

53  : f_(std::forward<Callable>(callable)),
54  stored_args_(std::forward<Args>(args)...) {}

Member Function Documentation

template<typename F , typename Tuple >
template<typename Self , std::size_t... I, typename... Args>
static auto folly::detail::partial::Partial< F, Tuple >::invokeForward ( Self &&  self,
index_sequence< I... >  ,
Args &&...  args 
) -> decltype(invoke( std::declval<Self>().f_, std::get<I>(std::declval<Self>().stored_args_)..., std::declval<Args>()...))
inlinestaticprivate

Definition at line 39 of file Partial.h.

References testing::Args(), and folly::invoke().

43  {
44  return invoke(
45  std::forward<Self>(self).f_,
46  std::get<I>(std::forward<Self>(self).stored_args_)...,
47  std::forward<Args>(args)...);
48  }
constexpr auto invoke(F &&f, Args &&...args) noexcept(noexcept(static_cast< F && >(f)(static_cast< Args && >(args)...))) -> decltype(static_cast< F && >(f)(static_cast< Args && >(args)...))
Definition: Invoke.h:49
template<typename F , typename Tuple >
template<typename... CArgs>
auto folly::detail::partial::Partial< F, Tuple >::operator() ( CArgs &&...  cargs) -> decltype(invokeForward( std::declval<Partial&>(), Indexes
inline

Definition at line 57 of file Partial.h.

59  {},
template<typename F , typename Tuple >
template<typename... CArgs>
auto folly::detail::partial::Partial< F, Tuple >::operator() ( CArgs &&...  cargs) const -> decltype(invokeForward( std::declval<const Partial&>(), Indexes
inline

Definition at line 64 of file Partial.h.

66  {},
template<typename F , typename Tuple >
template<typename... As>
auto folly::detail::partial::Partial< F, Tuple >::operator() ( As &&...  a) -> decltype(invokeForward( std::declval<Partial&&>(), Indexes
inline

Definition at line 71 of file Partial.h.

73  {},
template<typename F , typename Tuple >
template<typename... As>
auto folly::detail::partial::Partial< F, Tuple >::operator() ( As &&...  as) const -> decltype(invokeForward( std::declval<const Partial&&>(), Indexes
inline

Definition at line 78 of file Partial.h.

80  {},
template<typename F , typename Tuple >
folly::detail::partial::Partial< F, Tuple >::std::declval ( )
inline

Definition at line 60 of file Partial.h.

60  {
61  return invokeForward(*this, Indexes{}, std::forward<CArgs>(cargs)...);
62  }
make_index_sequence< std::tuple_size< Tuple >{}> Indexes
Definition: Partial.h:36
static auto invokeForward(Self &&self, index_sequence< I... >, Args &&...args) -> decltype(invoke(std::declval< Self >().f_, std::get< I >(std::declval< Self >().stored_args_)..., std::declval< Args >()...))
Definition: Partial.h:39
template<typename F , typename Tuple >
folly::detail::partial::Partial< F, Tuple >::std::declval ( )
inline

Definition at line 67 of file Partial.h.

67  {
68  return invokeForward(*this, Indexes{}, std::forward<CArgs>(cargs)...);
69  }
make_index_sequence< std::tuple_size< Tuple >{}> Indexes
Definition: Partial.h:36
static auto invokeForward(Self &&self, index_sequence< I... >, Args &&...args) -> decltype(invoke(std::declval< Self >().f_, std::get< I >(std::declval< Self >().stored_args_)..., std::declval< Args >()...))
Definition: Partial.h:39
template<typename F , typename Tuple >
folly::detail::partial::Partial< F, Tuple >::std::declval ( )
inline

Definition at line 74 of file Partial.h.

References a, and folly::gen::move.

74  {
75  return invokeForward(std::move(*this), Indexes{}, std::forward<As>(a)...);
76  }
make_index_sequence< std::tuple_size< Tuple >{}> Indexes
Definition: Partial.h:36
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
char a
static auto invokeForward(Self &&self, index_sequence< I... >, Args &&...args) -> decltype(invoke(std::declval< Self >().f_, std::get< I >(std::declval< Self >().stored_args_)..., std::declval< Args >()...))
Definition: Partial.h:39
template<typename F , typename Tuple >
folly::detail::partial::Partial< F, Tuple >::std::declval ( )
inline

Definition at line 81 of file Partial.h.

References folly::gen::as(), and folly::gen::move.

81  {
82  return invokeForward(std::move(*this), Indexes{}, std::forward<As>(as)...);
83  }
make_index_sequence< std::tuple_size< Tuple >{}> Indexes
Definition: Partial.h:36
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Collect as()
Definition: Base.h:811
static auto invokeForward(Self &&self, index_sequence< I... >, Args &&...args) -> decltype(invoke(std::declval< Self >().f_, std::get< I >(std::declval< Self >().stored_args_)..., std::declval< Args >()...))
Definition: Partial.h:39

Member Data Documentation

template<typename F , typename Tuple >
F folly::detail::partial::Partial< F, Tuple >::f_
private

Definition at line 87 of file Partial.h.

template<typename F , typename Tuple >
Tuple folly::detail::partial::Partial< F, Tuple >::stored_args_
private

Definition at line 90 of file Partial.h.


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