To access the Unreal Engine repository, you need to be granted private access by Epic Games. Refer this.
ForEach Blueprint Nodes for TMap and TSet Data TypesTMap and submitted a PR for it.ForEach node for TSet, so I worked on that separately.
GenericSet_Get and GenericSet_LastIndex to allow index-based iteration. This code inspired @MagForceSeven to revise the original TMap implementation based on it.K2_Node generation work was done solely by him.
TSet and TMap use sparse arrays, adding and removing elements can leave empty slots. To skip over these and access only valid indices, we need to use TScriptContainerIterator, created via FScriptSetHelper.CreateIterator(). The actual physical index can then be retrieved with TScriptContainerIterator.GetInternalIndex().