Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fmtlib to repository #44

Open
1 of 3 tasks
ahuston-0 opened this issue Jul 19, 2021 · 0 comments
Open
1 of 3 tasks

Add fmtlib to repository #44

ahuston-0 opened this issue Jul 19, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ahuston-0
Copy link
Collaborator

ahuston-0 commented Jul 19, 2021

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:

  • Add fmt to libraries being imported via CMake
  • Replace direct formatting that we do via sprintf with fmt
  • Replace fmt with std::format once it has been added to GCC
    • Will be done as a separate issue, most likely several months into the future.
@ahuston-0 ahuston-0 added the enhancement New feature or request label Jul 19, 2021
@ahuston-0 ahuston-0 self-assigned this Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant