How to generate an actor in c++?

can you elaborate question a little bit further? Are you asking how to make this function in c++ or something else like spawning c++ generated class from blueprints ?