diff --git a/src/include/units/physical/si/length.h b/src/include/units/physical/si/length.h index 212c57b6..8dc939bf 100644 --- a/src/include/units/physical/si/length.h +++ b/src/include/units/physical/si/length.h @@ -34,6 +34,8 @@ struct centimetre : prefixed_unit {}; struct decimetre : prefixed_unit {}; struct kilometre : prefixed_unit {}; +struct astronomical_unit : named_scaled_unit, metre> {}; + struct dim_length : physical::dim_length {}; template @@ -61,6 +63,10 @@ constexpr auto operator"" dm(long double l) { return length(l); } constexpr auto operator"" km(long double l) { return length(l); } +// au +constexpr auto operator"" au(unsigned long long l) { return length(l); } +constexpr auto operator"" au(long double l) { return length(l); } + } // namespace literals } // namespace units::si diff --git a/test/unit_test/static/si_test.cpp b/test/unit_test/static/si_test.cpp index 69205887..840a6778 100644 --- a/test/unit_test/static/si_test.cpp +++ b/test/unit_test/static/si_test.cpp @@ -55,6 +55,7 @@ static_assert(1km == 1000m); static_assert(1m == 100cm); static_assert(1m == 10dm); static_assert(1m == 1000mm); +static_assert(1au == 149'597'870'700m); static_assert(1km + 1m == 1001m); static_assert(10km / 5km == 2); static_assert(100mm / 5cm == 2);