Broken forwarding in visit
tgurriet opened this issue · 2 comments
tgurriet commented
Hello again,
There is a little issue with the get function. Something like:
struct S{int a; int b};
S s;
auto & a = reflect::get<0>(s);
doesn't work, as reflect::get<0>(s)
returns an rvalue reference.
I believe the issue is with the visit function, and is related to https://stackoverflow.com/questions/44219864/perfect-forwarding-of-variables-declared-with-structured-binding.
krzysztof-jusiak commented
Made the fix, works on gcc and clang but msvc complains, though I think it's not related to this issue but rather that msvc has problems with returning rvalues from the nth_pack_element
tgurriet commented
Thanks, you're the man!