2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-20 14:42:21 +00:00

some code formating

This commit is contained in:
Oliver Kowalke
2016-05-08 10:08:31 +02:00
parent e3ebf6f6ef
commit b734441ea6

View File

@@ -21,73 +21,73 @@
namespace boost {
namespace fibers {
template< class Function, class ... Args >
template< typename Fn, typename ... Args >
future<
typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type
>
async( launch policy, Function && fn, Args && ... args) {
async( launch policy, Fn && fn, Args && ... args) {
typedef typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type result_t;
packaged_task< result_t( typename std::decay< Args >::type ... ) > pt{
std::forward< Function >( fn) };
std::forward< Fn >( fn) };
future< result_t > f{ pt.get_future() };
fiber{ policy, std::move( pt), std::forward< Args >( args) ... }.detach();
return f;
}
template< class Function, class ... Args >
template< typename Fn, typename ... Args >
future<
typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type
>
async( Function && fn, Args && ... args) {
async( Fn && fn, Args && ... args) {
typedef typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type result_t;
packaged_task< result_t( typename std::decay< Args >::type ... ) > pt{
std::forward< Function >( fn) };
std::forward< Fn >( fn) };
future< result_t > f{ pt.get_future() };
fiber{ std::move( pt), std::forward< Args >( args) ... }.detach();
return f;
}
template< typename StackAllocator, class Function, class ... Args >
template< typename StackAllocator, typename Fn, typename ... Args >
future<
typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type
>
async( launch policy, std::allocator_arg_t, StackAllocator salloc, Function && fn, Args && ... args) {
async( launch policy, std::allocator_arg_t, StackAllocator salloc, Fn && fn, Args && ... args) {
typedef typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type result_t;
packaged_task< result_t( typename std::decay< Args >::type ... ) > pt{
std::allocator_arg, salloc, std::forward< Function >( fn) };
std::allocator_arg, salloc, std::forward< Fn >( fn) };
future< result_t > f{ pt.get_future() };
fiber{ policy, std::move( pt), std::forward< Args >( args) ... }.detach();
return f;
}
template< typename StackAllocator, class Function, class ... Args >
template< typename StackAllocator, typename Fn, typename ... Args >
future<
typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type
>
async( std::allocator_arg_t, StackAllocator salloc, Function && fn, Args && ... args) {
async( std::allocator_arg_t, StackAllocator salloc, Fn && fn, Args && ... args) {
typedef typename std::result_of<
typename std::decay< Function >::type( typename std::decay< Args >::type ... )
typename std::decay< Fn >::type( typename std::decay< Args >::type ... )
>::type result_t;
packaged_task< result_t( typename std::decay< Args >::type ... ) > pt{
std::allocator_arg, salloc, std::forward< Function >( fn) };
std::allocator_arg, salloc, std::forward< Fn >( fn) };
future< result_t > f{ pt.get_future() };
fiber{ std::move( pt), std::forward< Args >( args) ... }.detach();
return f;