feat: quantity point-like support

This commit is contained in:
Johel Ernesto Guerrero Peña
2021-02-17 19:40:52 +01:00
committed by Mateusz Pusz
parent 86584dbfe2
commit 8d6d43b32d
11 changed files with 110 additions and 2 deletions
@@ -39,6 +39,7 @@ using namespace units;
namespace si = physical::si;
using namespace si;
using namespace unit_constants;
using sys_seconds = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
constexpr auto cgs_cm = cgs::unit_constants::cm;
@@ -303,6 +304,8 @@ static_assert(!constructible_or_convertible_from<nth_apple<one, int>>(quantity_p
static_assert(!constructible_or_convertible_from<nth_apple<one, int>>(quantity_point(dimensionless<percent, int>(1))));
static_assert(!constructible_or_convertible_from<nth_apple<one, int>>(quantity_point(dimensionless<percent, double>(1))));
static_assert(!constructible_or_convertible_from<nth_apple<one, double>>(quantity_point(1.0 * s)));
static_assert(construct_from_only<quantity_point_kind<time_point_kind, second, int>>(sys_seconds{42s}).relative().common() == 42 * s);
// clang-format on