fix: compound assignment operations on quantities now behave the same as on the underying representation types

Resolves #137
This commit is contained in:
Mateusz Pusz committed 2024-10-29 09:18:32 +01:00
1 parent 797ae2e559
commit 7445585db8
3 files changed
+50 -23

No files matched your search

+2 -2
View File
@@ -137,8 +137,8 @@ static_assert(std::chrono::nanoseconds(quantity{1 * ns}) == 1ns);
static_assert(std::chrono::nanoseconds(quantity{1 * s}) == 1s);
// operators
static_assert((1 * s += 1s) == 2 * s);
static_assert((2 * s -= 1s) == 1 * s);
static_assert((1 * s += quantity{1s}) == 2 * s);
static_assert((2 * s -= quantity{1s}) == 1 * s);
static_assert(quantity{1s} + 1 * s == 2 * s);
static_assert(quantity{1s} + 1 * min == 61 * s);
static_assert(1 * s + quantity{1s} == 2 * s);