forked from mpusz/mp-units
decimetre and litre added
This commit is contained in:
@@ -31,6 +31,7 @@ namespace units::si {
|
||||
struct metre : named_unit<metre, "m", prefix> {};
|
||||
struct millimetre : prefixed_unit<millimetre, milli, metre> {};
|
||||
struct centimetre : prefixed_unit<centimetre, centi, metre> {};
|
||||
struct decimetre : prefixed_unit<decimetre, deci, metre> {};
|
||||
struct kilometre : prefixed_unit<kilometre, kilo, metre> {};
|
||||
|
||||
struct dim_length : physical::dim_length<metre> {};
|
||||
@@ -52,6 +53,10 @@ constexpr auto operator"" mm(long double l) { return length<millimetre, long dou
|
||||
constexpr auto operator"" cm(unsigned long long l) { return length<centimetre, std::int64_t>(l); }
|
||||
constexpr auto operator"" cm(long double l) { return length<centimetre, long double>(l); }
|
||||
|
||||
// dm
|
||||
constexpr auto operator"" dm(unsigned long long l) { return length<decimetre, std::int64_t>(l); }
|
||||
constexpr auto operator"" dm(long double l) { return length<decimetre, long double>(l); }
|
||||
|
||||
// km
|
||||
constexpr auto operator"" km(unsigned long long l) { return length<kilometre, std::int64_t>(l); }
|
||||
constexpr auto operator"" km(long double l) { return length<kilometre, long double>(l); }
|
||||
|
||||
@@ -35,6 +35,9 @@ struct cubic_millimetre : deduced_unit<cubic_millimetre, dim_volume, millimetre>
|
||||
struct cubic_centimetre : deduced_unit<cubic_centimetre, dim_volume, centimetre> {};
|
||||
struct cubic_kilometre : deduced_unit<cubic_kilometre, dim_volume, kilometre> {};
|
||||
|
||||
struct litre : deduced_unit<litre, dim_volume, decimetre> {};
|
||||
|
||||
|
||||
template<Unit U, Scalar Rep = double>
|
||||
using volume = quantity<dim_volume, U, Rep>;
|
||||
|
||||
@@ -56,6 +59,10 @@ constexpr auto operator""cub_m(long double l) { return volume<cubic_metre, long
|
||||
constexpr auto operator""cub_km(unsigned long long l) { return volume<cubic_kilometre, std::int64_t>(l); }
|
||||
constexpr auto operator""cub_km(long double l) { return volume<cubic_kilometre, long double>(l); }
|
||||
|
||||
// l
|
||||
constexpr auto operator""_l(unsigned long long l) { return volume<litre, std::int64_t>(l); }
|
||||
constexpr auto operator""_l(long double l) { return volume<litre, long double>(l); }
|
||||
|
||||
} // namespace literals
|
||||
|
||||
} // namespace units::si
|
||||
|
||||
Reference in New Issue
Block a user