Currently the formatting that we do is done through a combination of manual string concatenation, sprintf, and even direct byte manipulation in the case of XDL. While C++ 20 has a standard format library written up, it is not currently implemented in GCC or Clang, leaving us unable to test it. However, the open source library fmt seems to be the repository where the std::format proposal is implemented. As such, if we add the library to our build process we can get started using std::format-style formatting. This formatting library seems to be type-safe and more memory safe than our current implementations, plus it has been shown to be faster than sprintf in testing.
From their website, it seems the fmt library can be easily added by making the library an external CMake dependency, as we have done with GLM.
Proposal:
Currently the formatting that we do is done through a combination of manual string concatenation, sprintf, and even direct byte manipulation in the case of XDL. While C++ 20 has a standard format library written up, it is not currently implemented in GCC or Clang, leaving us unable to test it. However, the open source library
fmtseems to be the repository where the std::format proposal is implemented. As such, if we add the library to our build process we can get started using std::format-style formatting. This formatting library seems to be type-safe and more memory safe than our current implementations, plus it has been shown to be faster thansprintfin testing.From their website, it seems the
fmtlibrary can be easily added by making the library an external CMake dependency, as we have done with GLM.Proposal:
fmtto libraries being imported via CMakesprintfwithfmtfmtwithstd::formatonce it has been added to GCC