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
This is equivalent, but I think you really want std::tuple_element<1, std::tuple<int, double> >::type there instead (since that's what the specification says).
With a different custom structured binding implementation:
intf(Point p)
{
Point & __p20 = p;
type_t<int>::type& x = get<0UL>(__p20);
type_t<int>::type& y = get<1UL>(__p20);
return x;
}
I think in the customization point case, prefer to keep tuple_element<N, T>::type and not go through base classes of the particular tuple_element instantiation? Or, if you do, then go all the way and rewrite the above as int& instead of going most of the way through the instantiation process.
The text was updated successfully, but these errors were encountered:
Look at it in C++ Insights. There is appears as you expect it, correct? The difference is, that in this link I switch the STL to libc++ (libstdc++ is the default). This seems to have an influence.
With a different custom structured binding implementation:
Here the STL does have no influence. However, in the AST (using godbolt) line 92 and 94 show:
Which gets even more confusing if I wrote it this way:
I agree that it should be either the final type (int) or tuple_element. The first one I think is easier. With that the index issue would be solved as well.
I will see what I can do there, either ways it is a special case.
This example:
expands as:
This is equivalent, but I think you really want
std::tuple_element<1, std::tuple<int, double> >::type
there instead (since that's what the specification says).With a different custom structured binding implementation:
the binding there shows up as:
Instead of
std::tuple_element<1, Point>::type
.Which gets even more confusing if I wrote it this way:
because then I get:
I think in the customization point case, prefer to keep
tuple_element<N, T>::type
and not go through base classes of the particulartuple_element
instantiation? Or, if you do, then go all the way and rewrite the above asint&
instead of going most of the way through the instantiation process.The text was updated successfully, but these errors were encountered: