There already is a method which returns a temporary file, but it requires an input stream.
std::string CreateTemporaryFile(std::ofstream& tmpStream, std::ios_base::openmode mode, const std::string& templateName = "XXXXXX", std::string path = std::string());
Another method which doesn't need a stream would be helpful and save some lines of codes when a stream is not needed.