template< class R, class... Args >
packaged_task( R(*)(Args...) ) -> packaged_task<R(Args...)>;
template< class F >
packaged_task( F ) -> packaged_task</*see below*/>;
template< class F >
packaged_task( F ) -> packaged_task</*see below*/>;
template< class F >
packaged_task( F ) -> packaged_task</*see below*/>;
This overload participates in overload resolution only if
&F::operator()is well-formed when treated as an unevaluated operand and
decltype(&F::operator())is of the form
R(G::*)(A...)(optionally cv-qualified, optionally noexcept, optionally lvalue reference qualified). The deduced type is
std::packaged_task<R(A...)>.
3)This overload participates in overload resolution only if
&F::operator()is well-formed when treated as an unevaluated operand and
F::operator()is an
explicit object parameter functionwhose type is of form
R(G, A...)or
R(G, A...) noexcept. The deduced type is
std::packaged_task<R(A...)>.
4)This overload participates in overload resolution only if
&F::operator()is well-formed when treated as an unevaluated operand and
F::operator()is a
static member functionwhose type is of form
R(A...)or
R(A...) noexcept. The deduced type is
std::packaged_task<R(A...)>.
[edit] NotesThese deduction guides do not allow deduction from a function with ellipsis parameter, and the ... in the types is always treated as a pack expansion.
[edit] Example#include <future> int func(double) { return 0; } int main() { std::packaged_task f{func}; // deduces packaged_task<int(double)> int i = 5; std::packaged_task g = [&](double) { return i; }; // => packaged_task<int(double)> }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4