I have some C++11 code using the auto inferred type that I have to convert to C++98. How would I go about converting the code, substituting in the actual type f
As auto is known at compile-time, you need to interoperate with the compiler.
One option would be the Clang compiler's LibTooling library that provides infrastructure that you can base static analysis tools on.
For example, look at their refactoring example code that removes superfluous .c_str() calls from the code. I think you could write a similar tool that converts auto into the inferred type.