[llvm-bugs] [Bug 41654] New: tuple_size cannot take reference types

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 29 13:09:08 PDT 2019


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

            Bug ID: 41654
           Summary: tuple_size cannot take reference types
           Product: libc++
           Version: unspecified
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: z.zoelec2 at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Take the following example:

int main()
{
        auto t = std::make_tuple(make_tuple(10, 10));
        const auto arg_count1 =
std::tuple_size<std::remove_reference_t<decltype(std::get<0>(t))>>::value; //
works
        const auto arg_count2 =
std::tuple_size<decltype(std::get<0>(t))>::value; // fails
}

The above program generates the error: Implicit instantiation of undefined
template 'std::__1::tuple_size<std::__1::tuple<int, int> &>'

It errors because `std::get` returns a reference type.

-- 
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/20190429/17b23eeb/attachment-0001.html>


More information about the llvm-bugs mailing list