You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
& fails to compile on a const pack with a reference element #450
For an lvalue fn::pack<int&> const p, p & y fails inside the operator instead of yielding pack<int&, long>:
#include<fn/algebra.hpp>intmain()
{
int x = 1;
long y = 2;
fn::pack<int &> const p{x};
auto r = p & y; // error: no matching member function for call to 'append'
}
Copying p gives a pack<int&> bound to x. & instead extends p through append, which receives each element as a const pack hands it out, int const&; that cannot bind the new product's int& element. The error is hard, not a substitution failure: requires(fn::pack<int &> const &l, long &r) { l & r; } fails the same way rather than answering false.
Reproduced on main (b617188) with gcc 16.2.1 and clang 22.1.8.
After #448, a const copack<int&> conjoins: the product binds the referent as the alternative declares it, as a copy would. A const pack<int&> should do the same.
Activity