[llvm-bugs] [Bug 39606] New: std::function does not have deduction guides

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 9 10:47:44 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=39606

            Bug ID: 39606
           Summary: std::function does not have deduction guides
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldionne at apple.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181109/3e5daa4c/attachment-0001.html>


More information about the llvm-bugs mailing list