refactor: Repetitive inline constexpr removed as no longer needed

Not needed anymore as stated in cplusplus/draft#4601
This commit is contained in:
Mateusz Pusz
2024-09-05 08:43:36 +02:00
parent 2a4e1e3d95
commit 2e840cfdb4
95 changed files with 1765 additions and 1772 deletions

View File

@@ -39,9 +39,9 @@ using one_ = struct one;
// base dimensions
// clang-format off
inline constexpr struct dim_length_ final : base_dimension<"L"> {} dim_length;
inline constexpr struct dim_mass_ final : base_dimension<"M"> {} dim_mass;
inline constexpr struct dim_time_ final : base_dimension<"T"> {} dim_time;
constexpr struct dim_length_ final : base_dimension<"L"> {} dim_length;
constexpr struct dim_mass_ final : base_dimension<"M"> {} dim_mass;
constexpr struct dim_time_ final : base_dimension<"T"> {} dim_time;
// quantities specification
QUANTITY_SPEC_(length, dim_length);
@@ -64,37 +64,37 @@ QUANTITY_SPEC_(power, force* speed);
QUANTITY_SPEC_(storage_capacity, dimensionless, is_kind);
// base units
inline constexpr struct second_ final : named_unit<"s", kind_of<time>> {} second;
inline constexpr struct metre_ final : named_unit<"m", kind_of<length>> {} metre;
inline constexpr struct gram_ final : named_unit<"g", kind_of<mass>> {} gram;
inline constexpr auto kilogram = si::kilo<gram>;
constexpr struct second_ final : named_unit<"s", kind_of<time>> {} second;
constexpr struct metre_ final : named_unit<"m", kind_of<length>> {} metre;
constexpr struct gram_ final : named_unit<"g", kind_of<mass>> {} gram;
constexpr auto kilogram = si::kilo<gram>;
namespace nu {
// hypothetical natural system of units for c=1
inline constexpr struct second_ final : named_unit<"s"> {} second;
inline constexpr struct minute_ final : named_unit<"min", mag<60> * second> {} minute;
constexpr struct second_ final : named_unit<"s"> {} second;
constexpr struct minute_ final : named_unit<"min", mag<60> * second> {} minute;
inline constexpr struct time : system_reference<time_{}, second> {} time;
inline constexpr struct length : system_reference<length_{}, second> {} length;
inline constexpr struct speed : system_reference<speed_{}, second / second> {} speed;
constexpr struct time : system_reference<time_{}, second> {} time;
constexpr struct length : system_reference<length_{}, second> {} length;
constexpr struct speed : system_reference<speed_{}, second / second> {} speed;
}
// derived named units
inline constexpr struct radian_ final : named_unit<"rad", metre / metre, kind_of<angular_measure>> {} radian;
inline constexpr struct steradian_ final : named_unit<"sr", square(metre) / square(metre), kind_of<solid_angular_measure>> {} steradian;
inline constexpr struct hertz_ final : named_unit<"Hz", inverse(second), kind_of<frequency>> {} hertz;
inline constexpr struct becquerel_ final : named_unit<"Bq", inverse(second), kind_of<activity>> {} becquerel;
inline constexpr struct newton_ final : named_unit<"N", kilogram * metre / square(second)> {} newton;
inline constexpr struct joule_ final : named_unit<"J", newton * metre> {} joule;
inline constexpr struct watt_ final : named_unit<"W", joule / second> {} watt;
constexpr struct radian_ final : named_unit<"rad", metre / metre, kind_of<angular_measure>> {} radian;
constexpr struct steradian_ final : named_unit<"sr", square(metre) / square(metre), kind_of<solid_angular_measure>> {} steradian;
constexpr struct hertz_ final : named_unit<"Hz", inverse(second), kind_of<frequency>> {} hertz;
constexpr struct becquerel_ final : named_unit<"Bq", inverse(second), kind_of<activity>> {} becquerel;
constexpr struct newton_ final : named_unit<"N", kilogram * metre / square(second)> {} newton;
constexpr struct joule_ final : named_unit<"J", newton * metre> {} joule;
constexpr struct watt_ final : named_unit<"W", joule / second> {} watt;
inline constexpr struct minute_ final : named_unit<"min", mag<60> * second> {} minute;
inline constexpr struct hour_ final : named_unit<"h", mag<60> * minute> {} hour;
inline constexpr auto kilometre = si::kilo<metre>;
constexpr struct minute_ final : named_unit<"min", mag<60> * second> {} minute;
constexpr struct hour_ final : named_unit<"h", mag<60> * minute> {} hour;
constexpr auto kilometre = si::kilo<metre>;
inline constexpr struct bit_ final : named_unit<"bit", one, kind_of<storage_capacity>> {} bit;
constexpr struct bit_ final : named_unit<"bit", one, kind_of<storage_capacity>> {} bit;
// clang-format on