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
Just a quick note-to-self for future implementation.
It wouldn't be that hard to implement capture-by-reference semantics as supported by C++. Such vars would be specified in the capture list as &a, like in C++, and for these would store a pointer in the env struct. Copy-out would instead copy the value in the pointer, and an additional copy-back operation at the end of the lambda would copy the final value of the var back into the pointer.
Similarly, we could also support C++'s mutable capture-by-value by making the env struct vars non-const and copying back the final values of all variables directly into the struct.
The text was updated successfully, but these errors were encountered:
Just a quick note-to-self for future implementation.
It wouldn't be that hard to implement capture-by-reference semantics as supported by C++. Such vars would be specified in the capture list as
&a
, like in C++, and for these would store a pointer in the env struct. Copy-out would instead copy the value in the pointer, and an additional copy-back operation at the end of the lambda would copy the final value of the var back into the pointer.Similarly, we could also support C++'s mutable capture-by-value by making the env struct vars non-const and copying back the final values of all variables directly into the struct.
The text was updated successfully, but these errors were encountered: