Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions include/experimental/bits/await_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class __await_context_impl
public:
template <class _F, class _C, class... _A>
__await_context_impl(const executor_work<_Executor>& __w, _F&& __f, _C&& __c, _A&&... __args)
: _M_work(__w), _M_function(forward<_F>(__f)), _M_invocations(0),
_M_continuation(forward<_C>(__c)), _M_args(forward<_A>(__args)...)
: _M_work(__w), _M_function(std::forward<_F>(__f)), _M_invocations(0),
_M_continuation(std::forward<_C>(__c)), _M_args(std::forward<_A>(__args)...)
{
}

Expand Down Expand Up @@ -242,7 +242,7 @@ struct __await_context_result
template <class... _Args>
static void _Set_value(void* __r, _Args&&... __args)
{
*static_cast<_Type*>(__r) = _Tuple_get(std::make_tuple(forward<_Args>(__args)...));
*static_cast<_Type*>(__r) = _Tuple_get(std::make_tuple(std::forward<_Args>(__args)...));
}
};

Expand Down Expand Up @@ -274,7 +274,7 @@ struct __await_context_handler

template <class... _Args> void operator()(_Args&&... __args)
{
_Result::_Set_value(_M_impl->_M_result_value, forward<_Args>(__args)...);
_Result::_Set_value(_M_impl->_M_result_value, std::forward<_Args>(__args)...);
_M_impl->_Resume();
}

Expand Down Expand Up @@ -304,7 +304,7 @@ struct __await_context_handler<_Executor, error_code, _Values...>
*_M_impl->_M_result_ec = __e;
else if (__e)
_M_impl->_M_ex = make_exception_ptr(system_error(__e));
_Result::_Set_value(_M_impl->_M_result_value, forward<_Args>(__args)...);
_Result::_Set_value(_M_impl->_M_result_value, std::forward<_Args>(__args)...);
_M_impl->_Resume();
}

Expand Down Expand Up @@ -332,7 +332,7 @@ struct __await_context_handler<_Executor, exception_ptr, _Values...>
{
if (__e)
_M_impl->_M_ex = make_exception_ptr(__e);
_Result::_Set_value(_M_impl->_M_result_value, forward<_Args>(__args)...);
_Result::_Set_value(_M_impl->_M_result_value, std::forward<_Args>(__args)...);
_M_impl->_Resume();
}

Expand Down Expand Up @@ -382,19 +382,19 @@ struct __await_context_launcher
_Continuation _M_continuation;

template <class _F> __await_context_launcher(_F&& __f)
: _M_work(associated_executor<_Func>::get(__f)), _M_func(forward<_F>(__f))
: _M_work(associated_executor<_Func>::get(__f)), _M_func(std::forward<_F>(__f))
{
}

template <class _F> __await_context_launcher(
executor_arg_t, const _Executor& __e, _F&& __f)
: _M_work(__e), _M_func(forward<_F>(__f))
: _M_work(__e), _M_func(std::forward<_F>(__f))
{
}

template <class _F, class _C> __await_context_launcher(
true_type, const executor_work<_Executor>& __w, _F&& __f, _C&& __c)
: _M_work(__w), _M_func(forward<_F>(__f)), _M_continuation(forward<_C>(__c))
: _M_work(__w), _M_func(std::forward<_F>(__f)), _M_continuation(std::forward<_C>(__c))
{
}

Expand All @@ -407,7 +407,7 @@ struct __await_context_launcher
{
auto __impl = make_shared<__await_context_impl<
_Executor, _Func, _Continuation, typename decay<_Args>::type...>>(_M_work,
std::move(_M_func), std::move(_M_continuation), forward<_Args>(__args)...);
std::move(_M_func), std::move(_M_continuation), std::forward<_Args>(__args)...);
__impl->_Resume();
}
};
Expand Down Expand Up @@ -447,7 +447,7 @@ struct continuation_of<__await_context_launcher<_Executor, _Func>(_Args...)>
{
return __await_context_launcher<_Executor, _Func,
typename decay<_Continuation>::type>(true_type(), std::move(__f._M_work),
std::move(__f._M_func), forward<_Continuation>(__c));
std::move(__f._M_func), std::forward<_Continuation>(__c));
}
};

Expand Down
16 changes: 8 additions & 8 deletions include/experimental/bits/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class channel<_T, _Cont>::_Op

template <class _U> void _Set_value(_U&& __u)
{
new (&_M_value) value_type(forward<_U>(__u));
new (&_M_value) value_type(std::forward<_U>(__u));
_M_has_value = true;
}

Expand All @@ -44,7 +44,7 @@ class channel<_T, _Cont>::_Op
template <class _U>
_Op(_U&& __u)
{
this->_Set_value(forward<_U>(__u));
this->_Set_value(std::forward<_U>(__u));
}

~_Op()
Expand All @@ -66,7 +66,7 @@ class channel<_T, _Cont>::_PutOp
{
public:
template <class _U, class _H> explicit _PutOp(_U&& __u, _H&& __h)
: _Op(forward<_U>(__u)), _M_handler(forward<_H>(__h)),
: _Op(std::forward<_U>(__u)), _M_handler(std::forward<_H>(__h)),
_M_work(get_associated_executor(_M_handler))
{
}
Expand Down Expand Up @@ -107,7 +107,7 @@ class channel<_T, _Cont>::_GetOp
{
public:
template <class _H> explicit _GetOp(_H&& __h)
: _M_handler(forward<_H>(__h)), _M_work(get_associated_executor(_M_handler))
: _M_handler(std::forward<_H>(__h)), _M_work(get_associated_executor(_M_handler))
{
}

Expand Down Expand Up @@ -231,7 +231,7 @@ template <class _T, class _Cont> template <class _U>
void channel<_T, _Cont>::put(_U&& __u)
{
error_code __ec;
this->put(forward<_U>(__u), __ec);
this->put(std::forward<_U>(__u), __ec);
if (__ec)
throw system_error(__ec);
}
Expand All @@ -248,7 +248,7 @@ void channel<_T, _Cont>::put(_U&& __u, error_code& __ec)
}
case __channel_state::buffer:
{
_M_buffer.push_back(forward<_U>(__u));
_M_buffer.push_back(std::forward<_U>(__u));
_M_get_state = __channel_state::buffer;
if (_M_buffer.size() == _Capacity())
_M_put_state = __channel_state::block;
Expand All @@ -258,7 +258,7 @@ void channel<_T, _Cont>::put(_U&& __u, error_code& __ec)
case __channel_state::waiter:
{
_Op* __getter = static_cast<_Op*>(_M_waiters._Front());
__getter->_Set_value(forward<_U>(__u));
__getter->_Set_value(std::forward<_U>(__u));
_M_waiters._Pop();
if (_M_waiters._Empty())
_M_put_state = _Capacity() ? __channel_state::buffer : __channel_state::block;
Expand All @@ -283,7 +283,7 @@ auto channel<_T, _Cont>::put(_U&& __u, _CompletionToken&& __token)

auto __allocator(get_associated_allocator(__completion.handler));
auto __op(_Allocate_small_block<_PutOp<_Handler>>(__allocator,
forward<_U>(__u), std::move(__completion.handler)));
std::forward<_U>(__u), std::move(__completion.handler)));

_Start_put(__op.get());
__op.release();
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/bits/channel_void.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class channel<void, _Cont>::_Op
typedef executor_work<_Executor> _Work;

template <class _H> explicit _Op(_H&& __h)
: _M_handler(forward<_H>(__h)),
: _M_handler(std::forward<_H>(__h)),
_M_work(get_associated_executor(_M_handler))
{
}
Expand Down
4 changes: 2 additions & 2 deletions include/experimental/bits/codefer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct __coinvoke_defer
template <class _E, class _F, class _A>
void operator()(_E& __e, _F&& __f, const _A& __a)
{
__e.defer(forward<_F>(__f), __a);
__e.defer(std::forward<_F>(__f), __a);
}
};

Expand All @@ -45,7 +45,7 @@ struct __coinvoke_defer_ex
template <class _E, class _F, class _A>
void operator()(_E&, _F&& __f, const _A& __a)
{
__e.defer(forward<_F>(__f), __a);
__e.defer(std::forward<_F>(__f), __a);
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/experimental/bits/codispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct __coinvoke_dispatch
template <class _E, class _F, class _A>
void operator()(_E& __e, _F&& __f, const _A& __a)
{
__e.dispatch(forward<_F>(__f), __a);
__e.dispatch(std::forward<_F>(__f), __a);
}
};

Expand All @@ -45,7 +45,7 @@ struct __coinvoke_dispatch_ex
template <class _E, class _F, class _A>
void operator()(_E&, _F&& __f, const _A& __a)
{
__e.dispatch(forward<_F>(__f), __a);
__e.dispatch(std::forward<_F>(__f), __a);
}
};

Expand Down
10 changes: 5 additions & 5 deletions include/experimental/bits/coinvoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class __coinvoker_result
template <class... _Args> void _Set_value(_Args&&... __args)
{
assert(!_M_has_value);
new (&_M_value) _Result(forward<_Args>(__args)...);
new (&_M_value) _Result(std::forward<_Args>(__args)...);
_M_has_value = true;
}

Expand Down Expand Up @@ -95,7 +95,7 @@ class __coinvoker_tail<tuple<_HeadTokens...>, tuple<_TailToken>>

template <size_t _Index, class... _Args> void _Set_result(_Args&&... __args)
{
get<_Index>(_M_results)._Set_value(forward<_Args>(__args)...);
get<_Index>(_M_results)._Set_value(std::forward<_Args>(__args)...);
}

void _Complete()
Expand Down Expand Up @@ -162,7 +162,7 @@ class __coinvoker_tail_ptr

template <class... _Args> void operator()(_Args&&... __args)
{
_M_tail->template _Set_result<_Index>(forward<_Args>(__args)...);
_M_tail->template _Set_result<_Index>(std::forward<_Args>(__args)...);
auto* __t = _M_tail;
_M_tail = 0;
__t->_Complete();
Expand Down Expand Up @@ -260,7 +260,7 @@ class __coinvoker_launcher<tuple<_HeadTokens...>, tuple<_TailToken>>
{
_M_tail->_Prime();
_M_tail.release();
(_Go_2)(__a, forward<_Invokers>(__i)...);
(_Go_2)(__a, std::forward<_Invokers>(__i)...);
}

template <class _Action> static void _Go_2(_Action&) {}
Expand All @@ -271,7 +271,7 @@ class __coinvoker_launcher<tuple<_HeadTokens...>, tuple<_TailToken>>
auto __executor(__i._Get_executor());
auto __allocator(__i._Get_allocator());
__a(__executor, std::move(__i), __allocator);
(_Go_2)(__a, forward<_Invokers>(__j)...);
(_Go_2)(__a, std::forward<_Invokers>(__j)...);
}

unique_ptr<__coinvoker_tail<tuple<_HeadTokens...>, tuple<_TailToken>>> _M_tail;
Expand Down
20 changes: 10 additions & 10 deletions include/experimental/bits/continuation.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ class __continuation_impl<_Continuation, _R(_Args...)>
"continuation's continuation must accept specified return value");

template <class _T> explicit __continuation_impl(_T&& __t)
: _M_continuation(forward<_T>(__t)), _M_executor(associated_executor<_Continuation>::get(_M_continuation))
: _M_continuation(std::forward<_T>(__t)), _M_executor(associated_executor<_Continuation>::get(_M_continuation))
{
}

virtual void _Call(_Args... __args)
{
std::move(_M_continuation)(forward<_Args>(__args)...);
std::move(_M_continuation)(std::forward<_Args>(__args)...);
}

virtual void _Call_with_continuation(_Args... __args,
continuation<__make_signature_t<void, _R>>&& __c)
{
continuation_of<_Continuation(_Args...)>::chain(
std::move(_M_continuation), std::move(__c))(
forward<_Args>(__args)...);
std::forward<_Args>(__args)...);
}

virtual const type_info& _Target_type()
Expand Down Expand Up @@ -201,7 +201,7 @@ inline void continuation<_R(_Args...)>::operator()(_Args... __args)
{
if (!_M_impl)
throw bad_continuation();
_M_impl->_Call(forward<_Args>(__args)...);
_M_impl->_Call(std::forward<_Args>(__args)...);
}

template <class _R, class... _Args>
Expand Down Expand Up @@ -230,7 +230,7 @@ struct __continuation_chain

void operator()(_Args... __args)
{
_M_head._M_impl->_Call_with_continuation(forward<_Args>(__args)..., std::move(_M_tail));
_M_head._M_impl->_Call_with_continuation(std::forward<_Args>(__args)..., std::move(_M_tail));
}
};

Expand All @@ -242,7 +242,7 @@ struct continuation_of<continuation<_R(_Args...)>(_Args2...)>
template <class _C>
static auto chain(continuation<_R(_Args...)>&& __f, _C&& __c)
{
return __continuation_chain<_R, _Args...>{std::move(__f), forward<_C>(__c)};
return __continuation_chain<_R, _Args...>{std::move(__f), std::forward<_C>(__c)};
}
};

Expand Down Expand Up @@ -437,18 +437,18 @@ struct __continuation_launcher
continuation<_Signature> _M_continuation;

template <class _F> explicit __continuation_launcher(_F&& __f)
: _M_func(forward<_F>(__f))
: _M_func(std::forward<_F>(__f))
{
}

template <class _F, class _C> __continuation_launcher(_F&& __f, _C&& __c)
: _M_func(forward<_F>(__f)), _M_continuation(forward<_C>(__c))
: _M_func(std::forward<_F>(__f)), _M_continuation(std::forward<_C>(__c))
{
}

template <class... _Args> void operator()(_Args&&... __args)
{
std::move(_M_func)(forward<_Args>(__args)..., std::move(_M_continuation));
std::move(_M_func)(std::forward<_Args>(__args)..., std::move(_M_continuation));
}
};

Expand All @@ -461,7 +461,7 @@ struct continuation_of<__continuation_launcher<_Func, _Signature>(_Args...)>
static auto chain(__continuation_launcher<_Func, _Signature>&& __f, _Continuation&& __c)
{
return __continuation_launcher<_Func, _Signature>(
std::move(__f._M_func), forward<_Continuation>(__c));
std::move(__f._M_func), std::forward<_Continuation>(__c));
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/experimental/bits/copost.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct __coinvoke_post
template <class _E, class _F, class _A>
void operator()(_E& __e, _F&& __f, const _A& __a)
{
__e.post(forward<_F>(__f), __a);
__e.post(std::forward<_F>(__f), __a);
}
};

Expand All @@ -45,7 +45,7 @@ struct __coinvoke_post_ex
template <class _E, class _F, class _A>
void operator()(_E&, _F&& __f, const _A& __a)
{
__e.post(forward<_F>(__f), __a);
__e.post(std::forward<_F>(__f), __a);
}
};

Expand Down
6 changes: 3 additions & 3 deletions include/experimental/bits/exception_ptr_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ struct __exception_ptr_executor
template <class _F, class _A> void dispatch(_F&& __f, const _A& __a)
{
typedef typename decay<_F>::type _Func;
_M_executor.dispatch(__exception_ptr_call_wrapper<_Func>{_M_exception, forward<_F>(__f)}, __a);
_M_executor.dispatch(__exception_ptr_call_wrapper<_Func>{_M_exception, std::forward<_F>(__f)}, __a);
}

template <class _F, class _A> void post(_F&& __f, const _A& __a)
{
typedef typename decay<_F>::type _Func;
_M_executor.post(__exception_ptr_call_wrapper<_Func>{_M_exception, forward<_F>(__f)}, __a);
_M_executor.post(__exception_ptr_call_wrapper<_Func>{_M_exception, std::forward<_F>(__f)}, __a);
}

template <class _F, class _A> void defer(_F&& __f, const _A& __a)
{
typedef typename decay<_F>::type _Func;
_M_executor.defer(__exception_ptr_call_wrapper<_Func>{_M_exception, forward<_F>(__f)}, __a);
_M_executor.defer(__exception_ptr_call_wrapper<_Func>{_M_exception, std::forward<_F>(__f)}, __a);
}

friend bool operator==(const __exception_ptr_executor& __a, const __exception_ptr_executor& __b) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/experimental/bits/execution_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ template <class _Service, class... _Args> _Service&

// Creation is performed without holding lock, to allow reentrancy.
unique_ptr<execution_context::service> __new_s(
new _Service(__c, forward<_Args>(__args)...));
new _Service(__c, std::forward<_Args>(__args)...));
__new_s->_M_id = __id;

// Check if a duplicate was created while lock was not held.
Expand Down
Loading