We're missing deduction guides for std::function. The following code does not compile with libc++ trunk: -------------------------------------- #include <functional> int func(double) { return 0; } int main() { std::function f{func}; // guide #1 deduces function<int(double)> int i = 5; std::function g = [&](double) { return i; }; // guide #2 deduces function<int(double)> } -------------------------------------- Taken from SO question: https://stackoverflow.com/q/53217511/1708801
Fixed a while ago in: commit e1eabcdfad89f67ae575b0c86aa4a72d277378b4 Author: Louis Dionne <ldionne@apple.com> Date: Thu Jul 18 19:50:56 2019 +0000 [libc++] Add C++17 deduction guides for std::function Summary: http://llvm.org/PR39606 Reviewers: Quuxplusone Subscribers: christof, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D54410 llvm-svn: 366484