-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<future>
cleanups
#3940
<future>
cleanups
#3940
Conversation
_Packaged_state(const _Fty2& _Fnarg, const _Alloc& _Al, _Mydel* _Dp) | ||
: _Mybase(_Dp), _Fn(allocator_arg, _Al, _Fnarg) {} | ||
#endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are fully replaceable with their _Fty2&&
versions
@@ -1322,8 +1322,7 @@ public: | |||
void reset() { // reset to newly constructed state | |||
_MyStateManagerType& _State = _MyPromise._Get_state_for_set(); | |||
_MyStateType* _MyState = static_cast<_MyStateType*>(_State._Ptr()); | |||
function<_Ret(_ArgTypes...)> _Fnarg = _MyState->_Get_fn(); | |||
_MyPromiseType _New_promise(new _MyStateType(_Fnarg)); | |||
_MyPromiseType _New_promise(new _MyStateType(_MyState->_Get_fn())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 80% sure about this change; or was the extra copy construction intentional here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it was intentional.
Can you please provide PR descriptions so that reviewers, and future code archaeologists, can quickly understand what is being changed and why? Only for something completely trivial like "Fix comment typos" is a PR title sufficient. |
Hmm, added. |
Line 1403 in ed8150e
Now we should say |
I'm in favor of just fixing the comment here. "Good first issues" are a bit more work for the maintainers and we don't have a lot of capacity right now. |
I'm not bothered by this usage of |
@@ -1384,7 +1384,7 @@ public: | |||
|
|||
[[noreturn]] _Fake_no_copy_callable_adapter(const _Fake_no_copy_callable_adapter& _Other) | |||
: _Storage(_STD move(_Other._Storage)) { | |||
_CSTD abort(); // shouldn't be called, see GH-3888 | |||
_CSTD abort(); // shouldn't be called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
( I begin to feel "see GH-3888"
a bit awkward, as the reason has been explained at the beginning of the class :| )
@@ -1322,8 +1322,7 @@ public: | |||
void reset() { // reset to newly constructed state | |||
_MyStateManagerType& _State = _MyPromise._Get_state_for_set(); | |||
_MyStateType* _MyState = static_cast<_MyStateType*>(_State._Ptr()); | |||
function<_Ret(_ArgTypes...)> _Fnarg = _MyState->_Get_fn(); | |||
_MyPromiseType _New_promise(new _MyStateType(_Fnarg)); | |||
_MyPromiseType _New_promise(new _MyStateType(_MyState->_Get_fn())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it was intentional.
auto _Invoke_stored(tuple<_Types...>&& _Tuple) | ||
-> decltype(_Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{})) { // invoke() a tuple | ||
decltype(auto) _Invoke_stored(tuple<_Types...>&& _Tuple) { // invoke() a tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change requested: The difference here is that decltype(auto)
won't SFINAE, but it appears that we don't need SFINAE here (nothing can directly ask is_invocable
).
I think we can merge this without a second maintainer approval. |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
⏳ ⏱️ 🧹 |
decltype
return types withdecltype(auto)
in several places_Packaged_state
constructors_Packaged_state::_Get_fn
, and remove an extra copy construction around itusing
s private inpackaged_task
forward
patterns