C++: Accessing bone hierarchy

I am trying to write code that can access the reference transform from a skeleton asset in c++. I seem unable to do this. See the attached screenshots. Basically I want to take all those transforms from the skeleton and put them in a c++ array, given a reference to the skeleton.

Pretty simple stuff, right? I get a reference to a skeleton, i loop thru the entire hierarchy, and store each transform and name in arrays.

You can access the bone transforms of a SkeletalMeshComponent with the method GetComponentSpaceTransforms (or GetEditableComponentSpaceTransforms if you need to modify them).
Before 4.13, these used to be called GetSpaceBases and GetEditableSpaceBases respectively.
(BTW, they are actually methods defined in the SkinnedMeshComponent, but SkeletalMeshComponent inherits them).
You can get the index in that array of a particular bone by name, by calling GetBoneIndex(FName BoneName).