managarm / frigg

Lightweight C++ utilities and algorithms for system programming
MIT License
56 stars 20 forks source link

add lvalue ref support to tuples #25

Closed ArsenArsen closed 2 years ago

ArsenArsen commented 2 years ago

wait, this is nonsense

ArsenArsen commented 2 years ago

In the case of T being an lvalue reference, collapsing rules result in a cast to std::remove_reference_t<T>&, causing the reference to be copied. In all other cases, the resulting cast is to an rvalue reference.

I am not aware of any regressions, though my test cases were admittedly limited. I'm looking at expanding on a test suite to make it easier to know what's valid in the future.

EDIT: I remembered that a good test case is managarm/mlibc/libasync. libasync appears to fail to build with these changes. At least a relatively recent version builds now.