Pigweed
C/C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Functions
Pw_async2_pendable_for

Functions

template<auto MemberFunc, typename Traits = internal::PendableTraits<decltype(MemberFunc)>, typename = std::enable_if_t< Traits::kIsPendable && std::is_member_function_pointer_v<decltype(MemberFunc)>>, typename... Args>
constexpr MemberPendableWrapper< MemberFunc > pw::async2::PendableFor (typename Traits::Class &obj, Args &&... args)
 
template<auto FreeFunc, typename Traits = internal::PendableTraits<decltype(FreeFunc)>, typename = std::enable_if_t< Traits::kIsPendable && !std::is_member_function_pointer_v<decltype(FreeFunc)>>, typename... Args>
constexpr FreePendableWrapper< FreeFunc > pw::async2::PendableFor (Args &&... args)
 

Detailed Description

Function Documentation

◆ PendableFor() [1/2]

template<auto FreeFunc, typename Traits = internal::PendableTraits<decltype(FreeFunc)>, typename = std::enable_if_t< Traits::kIsPendable && !std::is_member_function_pointer_v<decltype(FreeFunc)>>, typename... Args>
constexpr FreePendableWrapper< FreeFunc > pw::async2::PendableFor ( Args &&...  args)
inlineconstexpr

Wraps a pendable free function in an object which has a single Pend method, allowing it to be used more broadly.

The wrapper stores the arguments used to invoke the target function. As a result, the argument types must be copyable.

The wrapping pendable object can only be used a single time. After its Pend method returns Ready, it will crash if called again.

◆ PendableFor() [2/2]

template<auto MemberFunc, typename Traits = internal::PendableTraits<decltype(MemberFunc)>, typename = std::enable_if_t< Traits::kIsPendable && std::is_member_function_pointer_v<decltype(MemberFunc)>>, typename... Args>
constexpr MemberPendableWrapper< MemberFunc > pw::async2::PendableFor ( typename Traits::Class &  obj,
Args &&...  args 
)
inlineconstexpr

Wraps a pendable member function in an object which has a single Pend method, allowing it to be used more broadly.

The wrapper stores the arguments used to invoke the target function. As a result, the argument types must be copyable.

The wrapping pendable object can only be used a single time. After its Pend method returns Ready, it will crash if called again.