How to attach weapon mesh from socket to socket c++

I want my character equip weapon from back socket to hand_r socket. I created IA_Draw to Bindaction with a function but i dont know how to code in this function. I saw a tut on yt : https://www.youtube.com/watch?v=d-5Flydzs3Q&t=473s and want to convert that BP to c++.