Translating Blueprints into C++ (Player rotation function)

How would I go about translating this Player rotation Blueprint function into a C++ function.
I have tried using the kismet maths library to access some of these functions but I have no idea how it works.

Any help or advice given is greatly appreciated.