Repository navigation
Conversation
|
It's a copy and variables shouldn't be pointers, but rather Value<> on their own. |
That is not the decomposition semantics. It's: copy construct pair, access x and y on the new object. |
|
The generated code should not loose the variable names. It should create the same bindings as in the original code. |
Creating individual variables is wrong. It would call the copy/move constructor of each variable which is not what
|
|
When the struct has a default copy constructor, you can decompose the clone straight away. |
Does not work if the struct has a default copy ctor but the fields have custom copy ctors.
This breaks the refcount model. If each decomposed variable becomes a Creating separate variables is not the C++ semantics. |
|
Creating variables with the same name is important for readability. C++ injects those names on the scope. |
Translate
auto [a, b] = ...; a == 0;aslet __decomp_N: T = ...; __decomp_N.a == 0.Currently it only works for decompositions over user-defined records and arrays. Decompositions over std::pair or other STL types don't work because they need
get<0>,get<1>rules which are blocked by #435.