I recall from a while back that LLVM coding style preferred using a literal char instead of a single-character string when writing to an output stream. That is:
OS << ' '; // Instead of OS << " ";
OS << '\n'; // Instead of OS << "\n";
Some of my code reviewers gave the same feedback as well, but this is not mentioned anywhere in the coding standard. I am assuming the only reason to prefer a character instead of a string is performance (else the string is more idiomatic). Currently the code has a mix of both, and I wanted to check if there is any reason to use single char over a string. In optimized builds, it would seem the performance is likely same.
We don’t need to document this necessarily in the CS but would be good to establish if there is a preference or both are acceptable, or maybe the preference is now to use the more idiomatic string.
Thanks