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.
They are fully replaceable with their _Fty2&& versions
| _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.
I'm 80% sure about this change; or was the extra copy construction intentional here?
There was a problem hiding this comment.
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 |
| [[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.
( I begin to feel "see GH-3888" a bit awkward, as the reason has been explained at the beginning of the class :| )
| _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.
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.
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. |
⏳ ⏱️ 🧹 |
decltypereturn types withdecltype(auto)in several places_Packaged_stateconstructors_Packaged_state::_Get_fn, and remove an extra copy construction around itusings private inpackaged_taskforwardpatterns