fix: inline restored for non-template constexpr global variables

This commit is contained in:
Mateusz Pusz
2024-09-05 10:06:43 +02:00
parent 2e840cfdb4
commit 45013f6752
63 changed files with 1591 additions and 1589 deletions
@@ -85,16 +85,16 @@ the `value_cast<U, Rep>(q)` which always returns the most precise result:
=== "C++23"
```cpp
constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
constexpr struct currency final : quantity_spec<dim_currency> {} currency;
inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
inline constexpr struct currency final : quantity_spec<dim_currency> {} currency;
constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
inline constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
namespace unit_symbols {
constexpr auto USD = us_dollar;
constexpr auto USD_s = scaled_us_dollar;
inline constexpr auto USD = us_dollar;
inline constexpr auto USD_s = scaled_us_dollar;
} // namespace unit_symbols
@@ -105,16 +105,16 @@ the `value_cast<U, Rep>(q)` which always returns the most precise result:
=== "C++20"
```cpp
constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
constexpr struct currency final : quantity_spec<currency, dim_currency> {} currency;
inline constexpr struct dim_currency final : base_dimension<"$"> {} dim_currency;
inline constexpr struct currency final : quantity_spec<currency, dim_currency> {} currency;
constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
inline constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
namespace unit_symbols {
constexpr auto USD = us_dollar;
constexpr auto USD_s = scaled_us_dollar;
inline constexpr auto USD = us_dollar;
inline constexpr auto USD_s = scaled_us_dollar;
} // namespace unit_symbols
@@ -125,16 +125,16 @@ the `value_cast<U, Rep>(q)` which always returns the most precise result:
=== "Portable"
```cpp
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 us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
inline constexpr struct us_dollar final : named_unit<"USD", kind_of<currency>> {} us_dollar;
inline constexpr struct scaled_us_dollar final : named_unit<"USD_s", mag_power<10, -8> * us_dollar> {} scaled_us_dollar;
namespace unit_symbols {
constexpr auto USD = us_dollar;
constexpr auto USD_s = scaled_us_dollar;
inline constexpr auto USD = us_dollar;
inline constexpr auto USD_s = scaled_us_dollar;
} // namespace unit_symbols