WG21 recently approved a change to std::function in the C++ standard library as the resolution of LWG issue 2774. As a result, the previous constructor signature:
template <class F> function(F fn);
was replaced by:
template <class F> function(F&& fn);
With the change implemented, that constructor becomes a better match for non-const unique_function arguments than unique_function's const-qualified deleted conversion operator template to std::function. As a result, std::is_convertible_v<unique_function<T>, std::function<T>> changes from false to true when Standard Libraries implement LWG-2774. MSVC recently implemented this LWG issue in microsoft/STL#2098 and noticed the unique_function test failing as a result.
- links to