make_task Template Function

Summary

Template function for creating a task_handle from a function or functor.

Syntax

// Supported until C++11
template<typename Func> 
task_handle<Func> make_task( const Func& f );

// Supported since C++11
template<typename TFunc> 
task_handle<Func> make_task( TFunc&& f );

Returns:task_handle<Func>(f)

Since C++11, the type Func is obtained by removing reference and const/volatile qualifiers remained after deduction of type TFunc.

For more complete information about compiler optimizations, see our Optimization Notice.