mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
[msvc][fix] some short names hide global identifier
This commit is contained in:
@@ -169,7 +169,7 @@ void example()
|
||||
const auto gliders = get_gliders();
|
||||
const auto waypoints = get_waypoints();
|
||||
const auto weather_conditions = get_weather_conditions();
|
||||
const task t = {waypoints[0], waypoints[1], waypoints[0]};
|
||||
const task glider_task = {waypoints[0], waypoints[1], waypoints[0]};
|
||||
const aircraft_tow tow = {400 * m, 1.6 * m / s};
|
||||
const timestamp start_time(std::chrono::system_clock::now());
|
||||
|
||||
@@ -177,16 +177,16 @@ void example()
|
||||
print(gliders);
|
||||
print(waypoints);
|
||||
print(weather_conditions);
|
||||
print(t);
|
||||
print(glider_task);
|
||||
print(tow);
|
||||
|
||||
for (const auto& g : gliders) {
|
||||
for (const auto& glider : gliders) {
|
||||
for (const auto& c : weather_conditions) {
|
||||
const std::string txt = "Scenario: Glider = " + g.name + ", Weather = " + c.first;
|
||||
const std::string txt = "Scenario: Glider = " + glider.name + ", Weather = " + c.first;
|
||||
std::cout << txt << "\n";
|
||||
std::cout << MP_UNITS_STD_FMT::format("{0:=^{1}}\n\n", "", txt.size());
|
||||
|
||||
estimate(start_time, g, c.second, t, sfty, tow);
|
||||
estimate(start_time, glider, c.second, glider_task, sfty, tow);
|
||||
|
||||
std::cout << "\n\n";
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ void to_base_specialization_of_base_dimension(const volatile base_dimension<Symb
|
||||
|
||||
template<typename T>
|
||||
inline constexpr bool is_derived_from_specialization_of_base_dimension =
|
||||
requires(T* t) { to_base_specialization_of_base_dimension(t); };
|
||||
requires(T* type) { to_base_specialization_of_base_dimension(type); };
|
||||
|
||||
/**
|
||||
* @brief A concept matching all named base dimensions in the library.
|
||||
|
@@ -45,7 +45,7 @@ void to_base_specialization_of_absolute_point_origin(const volatile absolute_poi
|
||||
|
||||
template<typename T>
|
||||
inline constexpr bool is_derived_from_specialization_of_absolute_point_origin =
|
||||
requires(T* t) { to_base_specialization_of_absolute_point_origin(t); };
|
||||
requires(T* type) { to_base_specialization_of_absolute_point_origin(type); };
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -67,7 +67,7 @@ void to_base_specialization_of_relative_point_origin(const volatile relative_poi
|
||||
|
||||
template<typename T>
|
||||
inline constexpr bool is_derived_from_specialization_of_relative_point_origin =
|
||||
requires(T* t) { to_base_specialization_of_relative_point_origin(t); };
|
||||
requires(T* type) { to_base_specialization_of_relative_point_origin(type); };
|
||||
|
||||
struct point_origin_interface;
|
||||
|
||||
@@ -100,7 +100,7 @@ void to_base_specialization_of_quantity_point(const volatile quantity_point<R, P
|
||||
|
||||
template<typename T>
|
||||
inline constexpr bool is_derived_from_specialization_of_quantity_point =
|
||||
requires(T* t) { to_base_specialization_of_quantity_point(t); };
|
||||
requires(T* type) { to_base_specialization_of_quantity_point(type); };
|
||||
|
||||
template<typename T>
|
||||
requires is_derived_from_specialization_of_quantity_point<T>
|
||||
|
@@ -765,14 +765,14 @@ template<int Complexity, QuantitySpec Q, typename Num, typename... Nums, typenam
|
||||
[[nodiscard]] consteval auto explode(Q, type_list<Num, Nums...>, type_list<Den, Dens...>)
|
||||
{
|
||||
constexpr auto n = get_complexity(Num{});
|
||||
constexpr auto d = get_complexity(Den{});
|
||||
constexpr auto max_compl = n > d ? n : d;
|
||||
constexpr auto den = get_complexity(Den{});
|
||||
constexpr auto max_compl = n > den ? n : den;
|
||||
|
||||
if constexpr (max_compl == Complexity || ((n >= d && !requires { explode_to_equation(Num{}); }) ||
|
||||
(n < d && !requires { explode_to_equation(Den{}); })))
|
||||
if constexpr (max_compl == Complexity || ((n >= den && !requires { explode_to_equation(Num{}); }) ||
|
||||
(n < den && !requires { explode_to_equation(Den{}); })))
|
||||
return explode_result{(map_power(Num{}) * ... * map_power(Nums{})) / (map_power(Den{}) * ... * map_power(Dens{}))};
|
||||
else {
|
||||
if constexpr (n >= d) {
|
||||
if constexpr (n >= den) {
|
||||
constexpr auto res = explode_to_equation(Num{});
|
||||
return explode<Complexity>((res.equation * ... * map_power(Nums{})) /
|
||||
(map_power(Den{}) * ... * map_power(Dens{})))
|
||||
@@ -801,8 +801,8 @@ template<int Complexity, QuantitySpec Q, typename Num, typename... Nums>
|
||||
template<int Complexity, QuantitySpec Q, typename Den, typename... Dens>
|
||||
[[nodiscard]] consteval auto explode(Q, type_list<>, type_list<Den, Dens...>)
|
||||
{
|
||||
constexpr auto d = get_complexity(Den{});
|
||||
if constexpr (d == Complexity || !requires { explode_to_equation(Den{}); })
|
||||
constexpr auto den = get_complexity(Den{});
|
||||
if constexpr (den == Complexity || !requires { explode_to_equation(Den{}); })
|
||||
return explode_result{dimensionless / (map_power(Den{}) * ... * map_power(Dens{}))};
|
||||
else {
|
||||
constexpr auto res = explode_to_equation(Den{});
|
||||
@@ -820,8 +820,8 @@ template<int Complexity, QuantitySpec Q>
|
||||
template<int Complexity, DerivedQuantitySpec Q>
|
||||
[[nodiscard]] consteval auto explode(Q q)
|
||||
{
|
||||
constexpr auto c = get_complexity(Q{});
|
||||
if constexpr (c > Complexity)
|
||||
constexpr auto complexity = get_complexity(Q{});
|
||||
if constexpr (complexity > Complexity)
|
||||
return explode<Complexity>(q, type_list_sort<typename Q::_num_, type_list_of_ingredients_less>{},
|
||||
type_list_sort<typename Q::_den_, type_list_of_ingredients_less>{});
|
||||
else
|
||||
@@ -831,8 +831,8 @@ template<int Complexity, DerivedQuantitySpec Q>
|
||||
template<int Complexity, NamedQuantitySpec Q>
|
||||
[[nodiscard]] consteval auto explode(Q q)
|
||||
{
|
||||
constexpr auto c = get_complexity(Q{});
|
||||
if constexpr (c > Complexity && requires { Q::_equation_; }) {
|
||||
constexpr auto complexity = get_complexity(Q{});
|
||||
if constexpr (complexity > Complexity && requires { Q::_equation_; }) {
|
||||
constexpr auto res = explode_to_equation(Q{});
|
||||
return explode<Complexity>(res.equation).common_convertibility_with(res);
|
||||
} else
|
||||
|
@@ -71,7 +71,7 @@ void to_base_specialization_of_quantity_spec(const volatile quantity_spec<T, Arg
|
||||
|
||||
template<typename T>
|
||||
inline constexpr bool is_derived_from_specialization_of_quantity_spec =
|
||||
requires(T* t) { to_base_specialization_of_quantity_spec(t); };
|
||||
requires(T* type) { to_base_specialization_of_quantity_spec(type); };
|
||||
|
||||
/**
|
||||
* @brief Concept matching all named quantity specification types
|
||||
|
@@ -128,9 +128,9 @@ public:
|
||||
MP_UNITS_EXPECTS(detail::is_basic_literal_character_set(a));
|
||||
}
|
||||
|
||||
constexpr symbol_text(const fixed_u8string<N>& u, const fixed_string<M>& a) : unicode_(u), ascii_(a)
|
||||
constexpr symbol_text(const fixed_u8string<N>& u, const fixed_string<M>& text) : unicode_(u), ascii_(text)
|
||||
{
|
||||
MP_UNITS_EXPECTS(detail::is_basic_literal_character_set(a.data_));
|
||||
MP_UNITS_EXPECTS(detail::is_basic_literal_character_set(text.data_));
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr const auto& unicode() const { return unicode_; }
|
||||
|
@@ -520,9 +520,9 @@ template<typename T, typename F, int Num, int... Den>
|
||||
template<typename... Us>
|
||||
[[nodiscard]] consteval auto get_canonical_unit_impl(const type_list<Us...>&)
|
||||
{
|
||||
auto m = (mp_units::mag<1> * ... * get_canonical_unit_impl(Us{}, Us{}).mag);
|
||||
auto magnitude = (mp_units::mag<1> * ... * get_canonical_unit_impl(Us{}, Us{}).mag);
|
||||
auto u = (one * ... * get_canonical_unit_impl(Us{}, Us{}).reference_unit);
|
||||
return canonical_unit{m, u};
|
||||
return canonical_unit{magnitude, u};
|
||||
}
|
||||
|
||||
template<Unit T, typename... Expr>
|
||||
@@ -654,8 +654,8 @@ template<Unit U1, Unit U2>
|
||||
else if constexpr (is_integral(canonical_rhs.mag / canonical_lhs.mag))
|
||||
return u1;
|
||||
else {
|
||||
constexpr auto cm = detail::common_magnitude(canonical_lhs.mag, canonical_rhs.mag);
|
||||
return scaled_unit<cm, decltype(canonical_lhs.reference_unit)>{};
|
||||
constexpr auto common_magnitude = detail::common_magnitude(canonical_lhs.mag, canonical_rhs.mag);
|
||||
return scaled_unit<common_magnitude, decltype(canonical_lhs.reference_unit)>{};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -311,9 +311,9 @@ struct derived_quantity : quantity<Q::reference, Rep> {
|
||||
R::operator=(t);
|
||||
return *this;
|
||||
}
|
||||
constexpr derived_quantity& operator=(R&& t)
|
||||
constexpr derived_quantity& operator=(R&& other)
|
||||
{
|
||||
R::operator=(std::move(t));
|
||||
R::operator=(std::move(other));
|
||||
return *this;
|
||||
}
|
||||
// NOLINTBEGIN(google-explicit-constructor, hicpp-explicit-conversions)
|
||||
|
Reference in New Issue
Block a user