clang-tools  8.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
clang::clangd::ForwardBinder< Func, Args > Struct Template Reference

Stores a callable object (Func) and arguments (Args) and allows to call the callable with provided arguments later using operator (). More...

#include <Function.h>

Collaboration diagram for clang::clangd::ForwardBinder< Func, Args >:
[legend]

Public Types

using Tuple = std::tuple< typename std::decay< Func >::type, typename std::decay< Args >::type... >
 

Public Member Functions

 ForwardBinder (Tuple FuncWithArguments)
 
template<class... RestArgs>
auto operator() (RestArgs &&... Rest) -> decltype(this->CallImpl(llvm::index_sequence_for< Args... >(), std::forward< RestArgs >(Rest)...))
 

Public Attributes

Tuple FuncWithArguments
 
bool WasCalled = false
 

Detailed Description

template<class Func, class... Args>
struct clang::clangd::ForwardBinder< Func, Args >

Stores a callable object (Func) and arguments (Args) and allows to call the callable with provided arguments later using operator ().

The arguments are std::forward'ed into the callable in the body of operator(). Therefore operator() can only be called once, as some of the arguments could be std::move'ed into the callable on first call.

Definition at line 36 of file Function.h.

Member Typedef Documentation

◆ Tuple

template<class Func , class... Args>
using clang::clangd::ForwardBinder< Func, Args >::Tuple = std::tuple<typename std::decay<Func>::type, typename std::decay<Args>::type...>

Definition at line 38 of file Function.h.

Constructor & Destructor Documentation

◆ ForwardBinder()

template<class Func , class... Args>
clang::clangd::ForwardBinder< Func, Args >::ForwardBinder ( Tuple  FuncWithArguments)
inline

Member Function Documentation

◆ operator()()

template<class Func , class... Args>
template<class... RestArgs>
auto clang::clangd::ForwardBinder< Func, Args >::operator() ( RestArgs &&...  Rest) -> decltype(this->CallImpl(llvm::index_sequence_for<Args...>(), std::forward<RestArgs>(Rest)...))
inline

Definition at line 62 of file Function.h.

Member Data Documentation

◆ FuncWithArguments

template<class Func , class... Args>
Tuple clang::clangd::ForwardBinder< Func, Args >::FuncWithArguments

◆ WasCalled

template<class Func , class... Args>
bool clang::clangd::ForwardBinder< Func, Args >::WasCalled = false

Definition at line 41 of file Function.h.


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