boostorg / boostorg/units

one/quantity support

Open
#39 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39
Forks
60
PR merge metrics
No merged PRs in 30d

Description

While working on an adaptation of a generic vector class to support `boost::units`, I found `boost::units::one` to be quite helpful. It can act as a substitute for a `unit_type` when there is no quantity (and no system of units) involved, e.g. just a built-in floating-point type.

Using `one` got me quite far until I tried to prepare for instances of units, or `one`, divided by actual values. This brings `divide_typeof_helper::type` into play. Which turns out to be `T`, even if `T` is a unit or a quantity type. (Such specializations are given in `detail/one.hpp` and `quantity.hpp`.) The expected result would be something with the reciprocated unit type, i.e. all base unit exponents sign-flipped.

I have looked for effects on officially documented functions, including `pow<-1>` (since `static_int_power_sign_impl` literally uses `divide_typeof_helper

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.