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: unassignedclangb...@nondot.org
          Reporter: z.zoel...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to