Conversation
added 4 commits
February 23, 2026 11:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a streamlined and user-friendly way to print quantities with their unit symbols, making output more readable and intuitive. The core changes revolve around adding a stream insertion (
operator<<) for quantities and ensuring every unit type provides a symbol for display. The demo and code generation are updated to leverage this new feature.Key changes include:
Printing and Display Enhancements
operator<<forQuantitytypes inffi_core.hpp, allowing quantities to be printed directly with their unit symbols (e.g.,1500 m,42.5 km). This significantly simplifies and improves output formatting.demo.cpp) to use the newoperator<<for all quantity outputs, replacing manual.value()and string concatenations. [1] [2]Unit Trait Improvements
symbol()method to allUnitTraitsspecializations for angular, length, and mass units, providing a string representation for each unit (e.g.,"m","kg","°"). [1] [2] [3]Code Generation
gen_cpp_units.pyto automatically emit thesymbol()method for each unit trait, ensuring consistency and reducing manual errors.Core Library Includes
<iostream>,<string_view>) inffi_core.hppto support the new stream insertion and symbol functionality.…tities