Hiho, thank you for your response on my topic.
However, I still do not understand why it didn't work for struct value types since I do not perform any mutations on the state objects during execution of the code.
The only thing happening with them is that they are getting copied bitwise and thus should have the same entries in the associative array as the original source, or am I wrong with this?
When value types are copied bitwise then the associative array should also be copied that way or at least point to the same mapping as the source and thus shouldn't be empty after copying.
What changes are required in order to make it work with struct value types as well? I even tried to change getNext to work with pointer return values instead but that did not help either.
Regards, Rob