mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 04:44:27 +02:00
fix: inline
restored for non-template constexpr
global variables
This commit is contained in:
@@ -40,22 +40,22 @@ import mp_units.core;
|
||||
using namespace mp_units;
|
||||
|
||||
// clang-format off
|
||||
constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
|
||||
inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
|
||||
|
||||
QUANTITY_SPEC(currency, dim_currency);
|
||||
|
||||
constexpr struct euro final : named_unit<"EUR", kind_of<currency>> {} euro;
|
||||
constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
|
||||
constexpr struct great_british_pound final : named_unit<"GBP", kind_of<currency>> {} great_british_pound;
|
||||
constexpr struct japanese_jen final : named_unit<"JPY", kind_of<currency>> {} japanese_jen;
|
||||
inline constexpr struct euro final : named_unit<"EUR", kind_of<currency>> {} euro;
|
||||
inline constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
|
||||
inline constexpr struct great_british_pound final : named_unit<"GBP", kind_of<currency>> {} great_british_pound;
|
||||
inline constexpr struct japanese_jen final : named_unit<"JPY", kind_of<currency>> {} japanese_jen;
|
||||
// clang-format on
|
||||
|
||||
namespace unit_symbols {
|
||||
|
||||
constexpr auto EUR = euro;
|
||||
constexpr auto USD = us_dollar;
|
||||
constexpr auto GBP = great_british_pound;
|
||||
constexpr auto JPY = japanese_jen;
|
||||
inline constexpr auto EUR = euro;
|
||||
inline constexpr auto USD = us_dollar;
|
||||
inline constexpr auto GBP = great_british_pound;
|
||||
inline constexpr auto JPY = japanese_jen;
|
||||
|
||||
} // namespace unit_symbols
|
||||
|
||||
|
@@ -44,7 +44,7 @@ import mp_units;
|
||||
|
||||
namespace geographic {
|
||||
|
||||
constexpr struct mean_sea_level final : mp_units::absolute_point_origin<mp_units::isq::altitude> {
|
||||
inline constexpr struct mean_sea_level final : mp_units::absolute_point_origin<mp_units::isq::altitude> {
|
||||
} mean_sea_level;
|
||||
|
||||
using msl_altitude = mp_units::quantity_point<mp_units::isq::altitude[mp_units::si::metre], mean_sea_level>;
|
||||
@@ -72,9 +72,9 @@ struct MP_UNITS_STD_FMT::formatter<geographic::msl_altitude, Char> :
|
||||
|
||||
namespace geographic {
|
||||
|
||||
constexpr struct equator final : mp_units::absolute_point_origin<mp_units::isq::angular_measure> {
|
||||
inline constexpr struct equator final : mp_units::absolute_point_origin<mp_units::isq::angular_measure> {
|
||||
} equator;
|
||||
constexpr struct prime_meridian final : mp_units::absolute_point_origin<mp_units::isq::angular_measure> {
|
||||
inline constexpr struct prime_meridian final : mp_units::absolute_point_origin<mp_units::isq::angular_measure> {
|
||||
} prime_meridian;
|
||||
|
||||
|
||||
|
@@ -40,7 +40,7 @@ import mp_units.core;
|
||||
#include <mp-units/framework/customization_points.h>
|
||||
#endif
|
||||
|
||||
constexpr struct validated_tag {
|
||||
inline constexpr struct validated_tag {
|
||||
} validated;
|
||||
|
||||
template<std::movable T, std::predicate<T> Validator>
|
||||
|
@@ -58,8 +58,8 @@ QUANTITY_SPEC(horizontal_length, isq::length);
|
||||
// with a constrained quantity equation
|
||||
QUANTITY_SPEC(horizontal_area, isq::area, horizontal_length* isq::width);
|
||||
|
||||
constexpr auto g = 1 * si::standard_gravity;
|
||||
constexpr auto air_density = isq::mass_density(1.225 * kg / m3);
|
||||
inline constexpr auto g = 1 * si::standard_gravity;
|
||||
inline constexpr auto air_density = isq::mass_density(1.225 * kg / m3);
|
||||
|
||||
class StorageTank {
|
||||
quantity<horizontal_area[m2]> base_;
|
||||
|
@@ -119,7 +119,7 @@ hae_altitude<M> to_hae(msl_altitude msl, position<long double> pos)
|
||||
// **** HAL ****
|
||||
|
||||
// clang-format off
|
||||
constexpr struct height_above_launch final : absolute_point_origin<isq::altitude> {} height_above_launch;
|
||||
inline constexpr struct height_above_launch final : absolute_point_origin<isq::altitude> {} height_above_launch;
|
||||
// clang-format on
|
||||
|
||||
using hal_altitude = quantity_point<isq::altitude[si::metre], height_above_launch>;
|
||||
|
Reference in New Issue
Block a user