mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
[msvc] remove MP_UNITS_CONSTRAINED_AUTO_WORKAROUND
This commit is contained in:
@@ -151,7 +151,7 @@ void example()
|
|||||||
const auto acceleration = isq::acceleration(measurement{9.8, 0.1} * m / s2);
|
const auto acceleration = isq::acceleration(measurement{9.8, 0.1} * m / s2);
|
||||||
const auto time = measurement{1.2, 0.1} * s;
|
const auto time = measurement{1.2, 0.1} * s;
|
||||||
|
|
||||||
const MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(QuantityOf<isq::velocity>) auto velocity = acceleration * time;
|
const QuantityOf<(isq::velocity)> auto velocity = acceleration * time;
|
||||||
std::cout << acceleration << " * " << time << " = " << velocity << " = " << velocity.in(km / h) << '\n';
|
std::cout << acceleration << " * " << time << " = " << velocity << " = " << velocity.in(km / h) << '\n';
|
||||||
|
|
||||||
const auto length = measurement{123., 1.} * m;
|
const auto length = measurement{123., 1.} * m;
|
||||||
|
@@ -76,7 +76,6 @@
|
|||||||
#if !defined MP_UNITS_HOSTED && defined __STDC_HOSTED__
|
#if !defined MP_UNITS_HOSTED && defined __STDC_HOSTED__
|
||||||
#define MP_UNITS_HOSTED __STDC_HOSTED__
|
#define MP_UNITS_HOSTED __STDC_HOSTED__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MP_UNITS_COMP_GCC
|
#if MP_UNITS_COMP_GCC
|
||||||
|
|
||||||
#define MP_UNITS_REMOVE_CONST(expr) std::remove_const_t<expr>
|
#define MP_UNITS_REMOVE_CONST(expr) std::remove_const_t<expr>
|
||||||
@@ -112,7 +111,6 @@ inline constexpr from_range_t from_range{};
|
|||||||
|
|
||||||
#if MP_UNITS_COMP_MSVC
|
#if MP_UNITS_COMP_MSVC
|
||||||
|
|
||||||
#define MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(X)
|
|
||||||
#define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X)
|
#define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X)
|
||||||
#define MP_UNITS_EXPRESSION_WORKAROUND(x) (x)
|
#define MP_UNITS_EXPRESSION_WORKAROUND(x) (x)
|
||||||
#define MP_UNITS_IS_VALUE_WORKAROUND(x) (x)
|
#define MP_UNITS_IS_VALUE_WORKAROUND(x) (x)
|
||||||
@@ -121,8 +119,7 @@ inline constexpr from_range_t from_range{};
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(X) X
|
#define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X) X
|
||||||
#define MP_UNITS_CONSTRAINED_NTTP_WORKAROUND(X) X'
|
|
||||||
#define MP_UNITS_EXPRESSION_WORKAROUND(x) x
|
#define MP_UNITS_EXPRESSION_WORKAROUND(x) x
|
||||||
#define MP_UNITS_IS_VALUE_WORKAROUND(x) x
|
#define MP_UNITS_IS_VALUE_WORKAROUND(x) x
|
||||||
#define MP_UNITS_IS_CONST_EXPR_WORKAROUND(x) x
|
#define MP_UNITS_IS_CONST_EXPR_WORKAROUND(x) x
|
||||||
|
@@ -220,7 +220,7 @@ struct propagate_point_origin<U, true> {
|
|||||||
template<Magnitude auto M, Unit U>
|
template<Magnitude auto M, Unit U>
|
||||||
struct scaled_unit_impl : detail::unit_interface, detail::propagate_point_origin<U> {
|
struct scaled_unit_impl : detail::unit_interface, detail::propagate_point_origin<U> {
|
||||||
using _base_type_ = scaled_unit_impl; // exposition only
|
using _base_type_ = scaled_unit_impl; // exposition only
|
||||||
static constexpr MP_UNITS_CONSTRAINED_AUTO_WORKAROUND(Magnitude) auto mag = M;
|
static constexpr Magnitude auto mag = M;
|
||||||
static constexpr U reference_unit{};
|
static constexpr U reference_unit{};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user