- Introduced CMake Workflow Presets
- Adjusted CMake to only look for Catch2 if tests are being built. Reduces warnings for projects which use something else (e.g. GTest)
- Change building instructions to work with conan 2.0 CMakeDeps generator - This sets the minimum CMake version to 3.23
- Remove conan recipe as it is maintained in the conan center index
- Add
angular_frequency_t
as type - Add operators to convert velocity to frequency and vice versa (i.e. velocity / length = frequency)
- Add CodeQL analysis to CI pipeline
- Bugfix:
unit.as<other_unit>()
automatically infers the underlying type if not explicitely specified. - Using Catch2 test discovery in CMake
- Removed implicit conversion from primitives to
unit_t
. See issue #106 for details - When converting units to string a space is inserted between the value and the unit, as described in the SI brochure, section 5.4.2
-
The numerical value always precedes the unit and a space is always used to separate the unit from the number
-
- Fix various spelling errors (thanks to melg8).
- Renamed
sterradiant_t
tosteradian_t
which is correct
- Fix reported issue that
operator/(scalar / unit)
would calculate the ratio into the value. - Add function
as<unit_t>()
to unit for convenient conversion to a unit of the same type but different ratio
- Add surface flow and volumetric flow units
- Add string conversions for velocity (
m/s
) and acceleration types (m/s^2
)
- Add
degree_t
to angle type including literals_deg
- Fix CI pipeline for windows
- Add missing conversion between float and double for operator/
- Update to catch 2.13.6 in the conan recipes
- Remove deployment to bintray.com as it is scheduled to sunset on May 1 2021
- Tests are built without the need for conan if catch2 is found. (using conan is still the preferred way)
- Cleaning up obsolete todos and typos
- Moved helper function such as
unit_cast
andunit_with_common_ratio
to own file for easier maintenance - Moved cross-unit-operations and
epsEqual
to a separate file for easier maintenance - Rename
epsEqual()
toeps_equals()
for consistency with naming scheme
- Add literals for ton types up to peta ton
- Add synonymous
*_ton_t
types for mass magnitudes - Renamed default branch from
master
tomain
- Documentation update and fixing typos in test names
- Full magnitudes for mass up to zetta_gram
- Refactored type dependent functions to use
std::enable_if_v
instead ofstd::enable_if::value
- Use value types for type traits (i.e.
std::is_arithmetic_v
instead ofstd::is_arithmetic::value
- Add
SI::detail::is_ratio_v
andSI::detail::is_unit_t_v
- Support for fractions as exponents (Types from version 1.x.x are no longer supported)
- Rename access to stored scalar values to
value()
(from previouslyraw_value()
) (Brakes interfaces from 1.x.x) - The conan-package is named
si
instead ofSI
to match the conan naming convention (Include-paths stay upper case)
- Refactoring conanfile.py to create cmake object only once for a tiny bit more performance when packing
conanfile.py
pulls the version out ofCMakeLists.txt
for packaging.- Selecting the cmake option
SI_INSTALL_LIBRARY=OFF
removes the targetinstall
completely - Add new-line to the end of all files to fit with the ConanCenter code convention.
- If SI is built from within conan the conanbuildinfo provided by conan will be used instead of getting it from github
- Cleanup of obsolete code
- Extended technical documentation
- Add speed of light to velocity
- Correct naming for angle types
radian_t
(wasradiant_t
) - Separate test for version consistency from installation tests
- Changed exponent type to
int8_t
aschar
might be unsigned - Documentation and tests are only built if built as top-level project
- Add literals and typedefs for km/h (
_km_p_h
) m/s (m_p_s
) - Add literals for astronomical units of length (AU), light-years (ly) and parsecs (pc)
- API documentation is built over the cmake-target
api_doc
- Add operators
++
and--
for units - Add cmake option
SI_ENABLE_TESTING
(defaultON
) to selectively disable tests for SI if used withadd_subdirectory()
andEXCLUDE_FROM_ALL
- Implicit type conversion for units (i.e. between units with internal
double
andfloat
representation) - Turn installation of by setting the cmake option
SI_INSTALL_LIBRARY
toOFF
(default isON
). (Thanks to bladan for bringing it up.) - Acceleration is buildable from v^2 / L (velocity squared divided by length). (Thanks to bladan for the work)
- Added
SI::to_string()
function to avoid using streams - Update to Catch2 v2.11.1 for testing
- Bugfix: Operators < and > where comparing the wrong way round (this is embarrassing)
- Added Operators <= and =>
- Installation tests for OSX and Windows
- Renamed SI/detail/string.h to unit_symbol.h because of resolution-problems in osx/xcode
- Added micro-benchmarks for operations on
unit_t
- Pulling catch2 for testing with conan is only done if testing is enabled
- Removed defaults for template parameters for
==
and!=
- Rule of five: assignment and construction for units with different ratios
- Retrieving Catch2 with conan to avoid having it in the repo (This no effect on using SI)
- Put version number in file comments (and testing for it)
- Overall linting
- Streaming operators for all dimension symbols
- Bugfix: Fixed dimension symbol clash between absorbed dose and equivalent dose
- Bugfix: Fixed dimension symbol clash between length and inductance
- Added operators +=, *=, /=, -= (Thanks to Kicer96 for the initial work)
- Added momentum (Thanks to Kicer96)
- Added packaging information for conan.io and deployment to bintray
- Changed spelling of length unit from 'meter' to 'metre' as this is the official SI spelling according to the International Bureau of Weights and Measures
- added
SI_
prefix to preprocessor flag to disable ratio conversion toSI_DISABLE_IMPLICIT_RATIO_CONVERSION
to scope it closer - Renamed template parameters to fit with c++ naming convention (See this stackoverflow thread)
- Unified usage of template arguments in unit_t
- electric conductance can be built from 1/Ohm (including all ratios)
- electric resistance can be built from 1/S (including all ratios)
- Implicit / automatic conversions between units of different ratio can be disabled with the preprocessor flag
DISABLE_IMPLICIT_RATIO_CONVERSION
- Fixed division of units with same exponent so it considers ratio
- Bugfix in division of units with different exponent and different ratios
- Multiplying units with different ratios results in multiplied ratios instead of gcd of ratios squared
- Added division of units by a scalar
- cmake requires version 3.12 to support add_executable without sources and verbose project description
- all headers are prefixed with a license tag
- Added support for cpack (see README for usage)
- Literal operators return explicit return types instead of auto
- Removed indirection for overflow check when parsing ints
- Fixed typo of luminosity unit from candela -> candela
- Updated catch2 to version 2.7.2
- Added angle (radian) and solid angle (steradian) typedefs
- luminous flux can be built from luminosity * solid_angle
- Added CHANGELOG.md
- Fixed bug in number parser, magnitude of a number is correctly counted even if a digit separator is present
- template specialization to differentiate scalar/unit for floating point and integral values
- Ran linter, minor cosmetic changes
- all cmake files use the same versions
- SI can be used with
add_subdirectory
thanks to cmake alias - compiler flags are set using generator expressions
Initial release, containing the base operators and template classes as well as typedefs the base units and named derived units of the International System of Units