fix: common_unit handling fixed for some corner cases
This commit is contained in:
1 parent
07e4e795c1
commit
569f27af8b
7 files changed
+58
-12
No files matched your search
@@ -20,6 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/systems/angular.h>
|
||||
#include <mp-units/systems/iau.h>
|
||||
#include <mp-units/systems/iec.h>
|
||||
#include <mp-units/systems/international.h>
|
||||
@@ -209,6 +210,10 @@ static_assert(unit_symbol(get_common_unit(kilo<metre> / hour, metre / second) /
|
||||
"EQUIV{[1/5 km/h], [1/18 m/s]}/s");
|
||||
static_assert(unit_symbol(get_common_unit(kilo<metre> / hour, metre / second) * second) ==
|
||||
"EQUIV{[1/5 km/h], [1/18 m/s]} s");
|
||||
static_assert(unit_symbol(get_common_unit(radian, degree)) == "EQUIV{[1/𝜋°], [1/180 rad]}");
|
||||
static_assert(unit_symbol(get_common_unit(angular::radian, angular::revolution)) == "EQUIV{rad, [2⁻¹ 𝜋⁻¹ rev]}");
|
||||
static_assert(unit_symbol<usf{.solidus = always}>(get_common_unit(angular::radian, angular::revolution)) ==
|
||||
"EQUIV{rad, [1/(2 𝜋) rev]}");
|
||||
|
||||
// derived units
|
||||
static_assert(unit_symbol(one) == ""); // NOLINT(readability-container-size-empty)
|
||||
|
||||
Reference in new issue
Block a user