Not directly related to your problem, but careful with “TArray<FMyStruct> SArr;”. The type you pass as template parameter must conform to some specification (see documentation about TArray) such as " Makes the assumption that your elements are relocate-able; i.e. that they can be transparently moved to new memory without a copy constructor.". Also if later you add attributes to this class, this may create performance issues or even runtime issues depending on their type. If in doubt, use pointers instead such as “TArray<FMyStruct*> SArr;”
the member function is named GetValueInSlot() but you are calling CurrentStruct.GetValInSlot()
the following code compiles fine under VS2017. It is syntaxically correct but as mentioned in 1. it may not be optimal.