Created on 2020-10-31.00:00:00 last changed 3 months ago
This wording is relative to N4868.
Modify [func.wrap.func.con] as indicated:
template<class F> function(F f);
-8- Constraints: F is Lvalue-Callable ([func.wrap.func.general]) for argument types ArgTypes... and return type R.-9- Preconditions: F meets the Cpp17CopyConstructible requirements. […]
[ 2021-01-15; Telecon prioritization ]
Set priority to 3 following reflector and telecon discussions.
[ 2020-11-01; Daniel comments ]
This issue has some overlap with LWG 2774.
In P0288, any_invocable is (correctly) constraining its constructor that takes an F:
template<class F> any_invocable(F&& f);
Let VT be decay_t<F>.Constraints:
— is_constructible_v<VT, F> is true, and
std::function doesn't do that. According to N4868, [func.wrap.func.con] p8 has a constraint for Lvalue-Callable, but not for copy-constructibility. There is a precondition in p9, but that's not enough for portable well/ill-formedness.Since this is a constructor, and we want to give the right answer to is_constructible/constructible_from queries, we should add the relevant constraint.
|2021-01-15 21:45:23||admin||set||messages: + msg11649|
|2020-11-01 16:53:29||admin||set||messages: + msg11525|
|2020-11-01 16:53:29||admin||set||messages: + msg11524|