[llvm-bugs] [Bug 35498] New: generate_n does not accept floating point Size arguments

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 1 10:08:21 PST 2017


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

            Bug ID: 35498
           Summary: generate_n does not accept floating point Size
                    arguments
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tkoeppe at google.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The type of the second parameter of std::generate_n, Size, is a template
parameter that "shall be convertible to an integral type". However, an argument
of type "double" is not accepted by libc++:


    #include <algorithm>

    int main()
    {
        int a[3];
        std::generate_n(a, 2.5, [](){return 8;});
        //                 ^^^
        //                 bad
    }

-- 
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/20171201/908c86fa/attachment.html>


More information about the llvm-bugs mailing list