In P4V you can use the Time-Lapse View tool to see the complete history of a file. https://www.perforce.com/manuals/p4v/Content/P4V/advanced_files.timelapse.html
As long as the function in question has stayed in the same general position in the file, it's pretty easy to follow its history by scrubbing through the file's timeline.
If you're looking for a more automated solution where you could provide a function name and get a list of changelists out rather than having to examine the file visually, p4 annotate -a
would be the starting point, but Perforce doesn't include any tools that would be able to specifically limit the query to a particular C++ structure, so you will need to supply or build your own tooling on top of what annotate
provides.