mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
refactor: TYPENAME
and CONSTEVAL
macros got MP_UNITS_
prefix
This commit is contained in:
@@ -442,7 +442,7 @@ public:
|
||||
template<typename ParseContext>
|
||||
class dynamic_specs_handler : public specs_setter<typename ParseContext::char_type> {
|
||||
public:
|
||||
using char_type = TYPENAME ParseContext::char_type;
|
||||
using char_type = MP_UNITS_TYPENAME ParseContext::char_type;
|
||||
|
||||
constexpr dynamic_specs_handler(dynamic_format_specs<char_type>& specs, ParseContext& ctx) :
|
||||
specs_setter<char_type>(specs), specs_(specs), context_(ctx)
|
||||
|
@@ -265,7 +265,7 @@ template<auto Reference, typename Rep, typename CharT>
|
||||
struct MP_UNITS_STD_FMT::formatter<mp_units::quantity<Reference, Rep>, CharT> {
|
||||
private:
|
||||
using quantity = mp_units::quantity<Reference, Rep>;
|
||||
using iterator = TYPENAME MP_UNITS_STD_FMT::basic_format_parse_context<CharT>::iterator;
|
||||
using iterator = MP_UNITS_TYPENAME MP_UNITS_STD_FMT::basic_format_parse_context<CharT>::iterator;
|
||||
|
||||
bool quantity_value = false;
|
||||
bool quantity_unit = false;
|
||||
|
@@ -113,7 +113,7 @@ struct expr_type_impl<power<T, Ints...>> : std::type_identity<T> {};
|
||||
} // namespace detail
|
||||
|
||||
template<typename T>
|
||||
using expr_type = TYPENAME detail::expr_type_impl<T>::type;
|
||||
using expr_type = MP_UNITS_TYPENAME detail::expr_type_impl<T>::type;
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -173,24 +173,25 @@ struct expr_consolidate_impl<type_list<T, Rest...>> {
|
||||
template<typename T, typename... Rest>
|
||||
requires(!is_specialization_of_power<T>)
|
||||
struct expr_consolidate_impl<type_list<T, T, Rest...>> {
|
||||
using type = TYPENAME expr_consolidate_impl<type_list<power<T, 2>, Rest...>>::type;
|
||||
using type = MP_UNITS_TYPENAME expr_consolidate_impl<type_list<power<T, 2>, Rest...>>::type;
|
||||
};
|
||||
|
||||
// replaces the instance of a type and a power of it with one with incremented power
|
||||
template<typename T, int... Ints, typename... Rest>
|
||||
struct expr_consolidate_impl<type_list<T, power<T, Ints...>, Rest...>> {
|
||||
using type = TYPENAME expr_consolidate_impl<type_list<power_or_T<T, power<T, Ints...>::exponent + 1>, Rest...>>::type;
|
||||
using type =
|
||||
MP_UNITS_TYPENAME expr_consolidate_impl<type_list<power_or_T<T, power<T, Ints...>::exponent + 1>, Rest...>>::type;
|
||||
};
|
||||
|
||||
// accumulates the powers of instances of the same type (removes the element in case the accumulation result is `0`)
|
||||
template<typename T, int... Ints1, int... Ints2, typename... Rest>
|
||||
struct expr_consolidate_impl<type_list<power<T, Ints1...>, power<T, Ints2...>, Rest...>> {
|
||||
static constexpr ratio r = power<T, Ints1...>::exponent + power<T, Ints2...>::exponent;
|
||||
using type = TYPENAME expr_consolidate_impl<type_list<power_or_T<T, r>, Rest...>>::type;
|
||||
using type = MP_UNITS_TYPENAME expr_consolidate_impl<type_list<power_or_T<T, r>, Rest...>>::type;
|
||||
};
|
||||
|
||||
template<typename List>
|
||||
using expr_consolidate = TYPENAME expr_consolidate_impl<List>::type;
|
||||
using expr_consolidate = MP_UNITS_TYPENAME expr_consolidate_impl<List>::type;
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -99,21 +99,21 @@
|
||||
|
||||
#if MP_UNITS_COMP_MSVC || (MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 16)
|
||||
|
||||
#define TYPENAME typename
|
||||
#define MP_UNITS_TYPENAME typename
|
||||
|
||||
#else
|
||||
|
||||
#define TYPENAME
|
||||
#define MP_UNITS_TYPENAME
|
||||
|
||||
#endif
|
||||
|
||||
#if MP_UNITS_COMP_CLANG
|
||||
|
||||
#define CONSTEVAL constexpr
|
||||
#define MP_UNITS_CONSTEVAL constexpr
|
||||
|
||||
#else
|
||||
|
||||
#define CONSTEVAL consteval
|
||||
#define MP_UNITS_CONSTEVAL consteval
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -75,7 +75,7 @@ struct type_list_map_impl<From<Args...>, To> {
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList From, template<typename...> typename To>
|
||||
using type_list_map = TYPENAME detail::type_list_map_impl<From, To>::type;
|
||||
using type_list_map = MP_UNITS_TYPENAME detail::type_list_map_impl<From, To>::type;
|
||||
|
||||
|
||||
// element
|
||||
@@ -123,7 +123,7 @@ struct type_list_front_impl<List<T, Ts...>> {
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList List>
|
||||
using type_list_front = TYPENAME detail::type_list_front_impl<List>::type;
|
||||
using type_list_front = MP_UNITS_TYPENAME detail::type_list_front_impl<List>::type;
|
||||
|
||||
|
||||
// back
|
||||
@@ -147,7 +147,7 @@ struct type_list_push_front_impl<List<OldTypes...>, NewTypes...> {
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList List, typename... Types>
|
||||
using type_list_push_front = TYPENAME detail::type_list_push_front_impl<List, Types...>::type;
|
||||
using type_list_push_front = MP_UNITS_TYPENAME detail::type_list_push_front_impl<List, Types...>::type;
|
||||
|
||||
|
||||
// push_back
|
||||
@@ -165,7 +165,7 @@ struct type_list_push_back_impl<List<OldTypes...>, NewTypes...> {
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList List, typename... Types>
|
||||
using type_list_push_back = TYPENAME detail::type_list_push_back_impl<List, Types...>::type;
|
||||
using type_list_push_back = MP_UNITS_TYPENAME detail::type_list_push_back_impl<List, Types...>::type;
|
||||
|
||||
|
||||
// join
|
||||
@@ -179,13 +179,13 @@ struct type_list_join_impl {
|
||||
|
||||
template<template<typename...> typename List, typename... First, typename... Second, typename... Rest>
|
||||
struct type_list_join_impl<List<First...>, List<Second...>, Rest...> {
|
||||
using type = TYPENAME type_list_join_impl<List<First..., Second...>, Rest...>::type;
|
||||
using type = MP_UNITS_TYPENAME type_list_join_impl<List<First..., Second...>, Rest...>::type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList... Lists>
|
||||
using type_list_join = TYPENAME detail::type_list_join_impl<Lists...>::type;
|
||||
using type_list_join = MP_UNITS_TYPENAME detail::type_list_join_impl<Lists...>::type;
|
||||
|
||||
|
||||
// split
|
||||
@@ -246,21 +246,22 @@ template<template<typename...> typename List, typename Lhs1, typename... LhsRest
|
||||
template<typename, typename> typename Pred>
|
||||
requires Pred<Lhs1, Rhs1>::value
|
||||
struct type_list_merge_sorted_impl<List<Lhs1, LhsRest...>, List<Rhs1, RhsRest...>, Pred> {
|
||||
using type = TYPENAME type_list_push_front_impl<
|
||||
using type = MP_UNITS_TYPENAME type_list_push_front_impl<
|
||||
typename type_list_merge_sorted_impl<List<LhsRest...>, List<Rhs1, RhsRest...>, Pred>::type, Lhs1>::type;
|
||||
};
|
||||
|
||||
template<template<typename...> typename List, typename Lhs1, typename... LhsRest, typename Rhs1, typename... RhsRest,
|
||||
template<typename, typename> typename Pred>
|
||||
struct type_list_merge_sorted_impl<List<Lhs1, LhsRest...>, List<Rhs1, RhsRest...>, Pred> {
|
||||
using type = TYPENAME type_list_push_front_impl<
|
||||
using type = MP_UNITS_TYPENAME type_list_push_front_impl<
|
||||
typename type_list_merge_sorted_impl<List<Lhs1, LhsRest...>, List<RhsRest...>, Pred>::type, Rhs1>::type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList SortedList1, TypeList SortedList2, template<typename, typename> typename Pred>
|
||||
using type_list_merge_sorted = TYPENAME detail::type_list_merge_sorted_impl<SortedList1, SortedList2, Pred>::type;
|
||||
using type_list_merge_sorted =
|
||||
MP_UNITS_TYPENAME detail::type_list_merge_sorted_impl<SortedList1, SortedList2, Pred>::type;
|
||||
|
||||
|
||||
// sort
|
||||
@@ -284,15 +285,15 @@ template<template<typename...> typename List, typename... Types, template<typena
|
||||
struct type_list_sort_impl<List<Types...>, Pred> {
|
||||
using types = List<Types...>;
|
||||
using split = type_list_split_half<List<Types...>>;
|
||||
using sorted_left = TYPENAME type_list_sort_impl<typename split::first_list, Pred>::type;
|
||||
using sorted_right = TYPENAME type_list_sort_impl<typename split::second_list, Pred>::type;
|
||||
using type = TYPENAME type_list_merge_sorted_impl<sorted_left, sorted_right, Pred>::type;
|
||||
using sorted_left = MP_UNITS_TYPENAME type_list_sort_impl<typename split::first_list, Pred>::type;
|
||||
using sorted_right = MP_UNITS_TYPENAME type_list_sort_impl<typename split::second_list, Pred>::type;
|
||||
using type = MP_UNITS_TYPENAME type_list_merge_sorted_impl<sorted_left, sorted_right, Pred>::type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<TypeList List, template<typename, typename> typename Pred>
|
||||
using type_list_sort = TYPENAME detail::type_list_sort_impl<List, Pred>::type;
|
||||
using type_list_sort = MP_UNITS_TYPENAME detail::type_list_sort_impl<List, Pred>::type;
|
||||
|
||||
} // namespace mp_units
|
||||
|
||||
|
@@ -46,7 +46,7 @@ struct conditional_impl<true> {
|
||||
} // namespace detail
|
||||
|
||||
template<bool B, typename T, typename F>
|
||||
using conditional = TYPENAME detail::conditional_impl<B>::template type<T, F>;
|
||||
using conditional = MP_UNITS_TYPENAME detail::conditional_impl<B>::template type<T, F>;
|
||||
|
||||
// is_same
|
||||
template<class T, class U>
|
||||
|
@@ -194,7 +194,7 @@ template<MagnitudeSpec Element>
|
||||
}
|
||||
|
||||
template<MagnitudeSpec Element>
|
||||
[[nodiscard]] CONSTEVAL ratio get_exponent(Element)
|
||||
[[nodiscard]] MP_UNITS_CONSTEVAL ratio get_exponent(Element)
|
||||
{
|
||||
if constexpr (detail::is_specialization_of_power_v<Element>)
|
||||
return Element::exponent;
|
||||
|
@@ -33,7 +33,7 @@ namespace mp_units {
|
||||
namespace detail {
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] CONSTEVAL T abs(T v) noexcept
|
||||
[[nodiscard]] MP_UNITS_CONSTEVAL T abs(T v) noexcept
|
||||
{
|
||||
return v < 0 ? -v : v;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ struct ratio {
|
||||
std::intmax_t num;
|
||||
std::intmax_t den;
|
||||
|
||||
CONSTEVAL explicit(false) ratio(std::intmax_t n, std::intmax_t d = 1) : num{n}, den{d}
|
||||
MP_UNITS_CONSTEVAL explicit(false) ratio(std::intmax_t n, std::intmax_t d = 1) : num{n}, den{d}
|
||||
{
|
||||
gsl_Expects(den != 0);
|
||||
if (num == 0)
|
||||
@@ -82,14 +82,14 @@ struct ratio {
|
||||
[[nodiscard]] friend consteval bool operator==(ratio, ratio) = default;
|
||||
[[nodiscard]] friend consteval auto operator<=>(ratio lhs, ratio rhs) { return (lhs - rhs).num <=> 0; }
|
||||
|
||||
[[nodiscard]] friend CONSTEVAL ratio operator-(ratio r) { return ratio{-r.num, r.den}; }
|
||||
[[nodiscard]] friend MP_UNITS_CONSTEVAL ratio operator-(ratio r) { return ratio{-r.num, r.den}; }
|
||||
|
||||
[[nodiscard]] friend CONSTEVAL ratio operator+(ratio lhs, ratio rhs)
|
||||
[[nodiscard]] friend MP_UNITS_CONSTEVAL ratio operator+(ratio lhs, ratio rhs)
|
||||
{
|
||||
return ratio{lhs.num * rhs.den + lhs.den * rhs.num, lhs.den * rhs.den};
|
||||
}
|
||||
|
||||
[[nodiscard]] friend CONSTEVAL ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); }
|
||||
[[nodiscard]] friend MP_UNITS_CONSTEVAL ratio operator-(ratio lhs, ratio rhs) { return lhs + (-rhs); }
|
||||
|
||||
[[nodiscard]] friend consteval ratio operator*(ratio lhs, ratio rhs)
|
||||
{
|
||||
|
@@ -62,11 +62,11 @@ template<Quantity To, typename From>
|
||||
constexpr auto q_unit = std::remove_reference_t<From>::unit;
|
||||
if constexpr (q_unit == To::unit) {
|
||||
// no scaling of the number needed
|
||||
return make_quantity<To::reference>(
|
||||
static_cast<TYPENAME To::rep>(std::forward<From>(q).number())); // this is the only (and recommended) way to do
|
||||
// a truncating conversion on a number, so we are
|
||||
// using static_cast to suppress all the compiler
|
||||
// warnings on conversions
|
||||
return make_quantity<To::reference>(static_cast<MP_UNITS_TYPENAME To::rep>(
|
||||
std::forward<From>(q).number())); // this is the only (and recommended) way to do
|
||||
// a truncating conversion on a number, so we are
|
||||
// using static_cast to suppress all the compiler
|
||||
// warnings on conversions
|
||||
} else {
|
||||
// scale the number
|
||||
constexpr Magnitude auto c_mag = get_canonical_unit(q_unit).mag / get_canonical_unit(To::unit).mag;
|
||||
@@ -78,8 +78,8 @@ template<Quantity To, typename From>
|
||||
using multiplier_type =
|
||||
conditional<treat_as_floating_point<c_rep_type>, std::common_type_t<c_mag_type, long double>, c_mag_type>;
|
||||
constexpr auto val = [](Magnitude auto m) { return get_value<multiplier_type>(m); };
|
||||
return static_cast<TYPENAME To::rep>(static_cast<c_rep_type>(std::forward<From>(q).number()) * val(num) / val(den) *
|
||||
val(irr)) *
|
||||
return static_cast<MP_UNITS_TYPENAME To::rep>(static_cast<c_rep_type>(std::forward<From>(q).number()) * val(num) /
|
||||
val(den) * val(irr)) *
|
||||
To::reference;
|
||||
}
|
||||
}
|
||||
|
@@ -96,8 +96,8 @@ template<QuantityPointOf<isq::time> QP>
|
||||
requires is_specialization_of<std::remove_const_t<decltype(QP::absolute_point_origin)>, chrono_point_origin_>
|
||||
[[nodiscard]] constexpr auto to_chrono_time_point(const QP& qp)
|
||||
{
|
||||
using clock = TYPENAME decltype(QP::absolute_point_origin)::clock;
|
||||
using rep = TYPENAME QP::rep;
|
||||
using clock = MP_UNITS_TYPENAME decltype(QP::absolute_point_origin)::clock;
|
||||
using rep = MP_UNITS_TYPENAME QP::rep;
|
||||
constexpr auto canonical = detail::get_canonical_unit(QP::unit);
|
||||
constexpr ratio r = as_ratio(canonical.mag);
|
||||
using ret_type = std::chrono::time_point<clock, std::chrono::duration<rep, std::ratio<r.num, r.den>>>;
|
||||
|
@@ -54,7 +54,7 @@ static std::vector<typename Q::rep> bl_qty_to_rep(std::initializer_list<Q>& bl)
|
||||
template<Quantity Q, typename UnaryOperation>
|
||||
inline static std::vector<typename Q::rep> fw_bl_pwc(std::initializer_list<Q>& bl, UnaryOperation fw)
|
||||
{
|
||||
using rep = TYPENAME Q::rep;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
std::vector<rep> w_bl;
|
||||
w_bl.reserve(bl.size());
|
||||
for (const Q& qty : bl) {
|
||||
@@ -84,8 +84,8 @@ static std::vector<typename Q::rep> fw_bl_pwl(std::initializer_list<Q>& bl, Unar
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct uniform_int_distribution : public std::uniform_int_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::uniform_int_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::uniform_int_distribution<rep>;
|
||||
|
||||
uniform_int_distribution() : base() {}
|
||||
uniform_int_distribution(const Q& a, const Q& b) : base(a.number(), b.number()) {}
|
||||
@@ -106,8 +106,8 @@ struct uniform_int_distribution : public std::uniform_int_distribution<typename
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct uniform_real_distribution : public std::uniform_real_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::uniform_real_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::uniform_real_distribution<rep>;
|
||||
|
||||
uniform_real_distribution() : base() {}
|
||||
uniform_real_distribution(const Q& a, const Q& b) : base(a.number(), b.number()) {}
|
||||
@@ -128,8 +128,8 @@ struct uniform_real_distribution : public std::uniform_real_distribution<typenam
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct binomial_distribution : public std::binomial_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::binomial_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::binomial_distribution<rep>;
|
||||
|
||||
binomial_distribution() : base() {}
|
||||
binomial_distribution(const Q& t, double p) : base(t.number(), p) {}
|
||||
@@ -149,8 +149,8 @@ struct binomial_distribution : public std::binomial_distribution<typename Q::rep
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct negative_binomial_distribution : public std::negative_binomial_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::negative_binomial_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::negative_binomial_distribution<rep>;
|
||||
|
||||
negative_binomial_distribution() : base() {}
|
||||
negative_binomial_distribution(const Q& k, double p) : base(k.number(), p) {}
|
||||
@@ -170,8 +170,8 @@ struct negative_binomial_distribution : public std::negative_binomial_distributi
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct geometric_distribution : public std::geometric_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::geometric_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::geometric_distribution<rep>;
|
||||
|
||||
geometric_distribution() : base() {}
|
||||
geometric_distribution(double p) : base(p) {}
|
||||
@@ -189,8 +189,8 @@ struct geometric_distribution : public std::geometric_distribution<typename Q::r
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct poisson_distribution : public std::poisson_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::poisson_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::poisson_distribution<rep>;
|
||||
|
||||
poisson_distribution() : base() {}
|
||||
explicit poisson_distribution(double p) : base(p) {}
|
||||
@@ -208,8 +208,8 @@ struct poisson_distribution : public std::poisson_distribution<typename Q::rep>
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct exponential_distribution : public std::exponential_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::exponential_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::exponential_distribution<rep>;
|
||||
|
||||
exponential_distribution() : base() {}
|
||||
explicit exponential_distribution(const rep& lambda) : base(lambda) {}
|
||||
@@ -227,8 +227,8 @@ struct exponential_distribution : public std::exponential_distribution<typename
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct gamma_distribution : public std::gamma_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::gamma_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::gamma_distribution<rep>;
|
||||
|
||||
gamma_distribution() : base() {}
|
||||
gamma_distribution(const rep& alpha, const rep& beta) : base(alpha, beta) {}
|
||||
@@ -246,8 +246,8 @@ struct gamma_distribution : public std::gamma_distribution<typename Q::rep> {
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct weibull_distribution : public std::weibull_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::weibull_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::weibull_distribution<rep>;
|
||||
|
||||
weibull_distribution() : base() {}
|
||||
weibull_distribution(const rep& a, const rep& b) : base(a, b) {}
|
||||
@@ -265,8 +265,8 @@ struct weibull_distribution : public std::weibull_distribution<typename Q::rep>
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct extreme_value_distribution : public std::extreme_value_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::extreme_value_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::extreme_value_distribution<rep>;
|
||||
|
||||
extreme_value_distribution() : base() {}
|
||||
extreme_value_distribution(const Q& a, const rep& b) : base(a.number(), b) {}
|
||||
@@ -286,8 +286,8 @@ struct extreme_value_distribution : public std::extreme_value_distribution<typen
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct normal_distribution : public std::normal_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::normal_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::normal_distribution<rep>;
|
||||
|
||||
normal_distribution() : base() {}
|
||||
normal_distribution(const Q& mean, const Q& stddev) : base(mean.number(), stddev.number()) {}
|
||||
@@ -308,8 +308,8 @@ struct normal_distribution : public std::normal_distribution<typename Q::rep> {
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct lognormal_distribution : public std::lognormal_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::lognormal_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::lognormal_distribution<rep>;
|
||||
|
||||
lognormal_distribution() : base() {}
|
||||
lognormal_distribution(const Q& m, const Q& s) : base(m.number(), s.number()) {}
|
||||
@@ -330,8 +330,8 @@ struct lognormal_distribution : public std::lognormal_distribution<typename Q::r
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct chi_squared_distribution : public std::chi_squared_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::chi_squared_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::chi_squared_distribution<rep>;
|
||||
|
||||
chi_squared_distribution() : base() {}
|
||||
explicit chi_squared_distribution(const rep& n) : base(n) {}
|
||||
@@ -349,8 +349,8 @@ struct chi_squared_distribution : public std::chi_squared_distribution<typename
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct cauchy_distribution : public std::cauchy_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::cauchy_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::cauchy_distribution<rep>;
|
||||
|
||||
cauchy_distribution() : base() {}
|
||||
cauchy_distribution(const Q& a, const Q& b) : base(a.number(), b.number()) {}
|
||||
@@ -371,8 +371,8 @@ struct cauchy_distribution : public std::cauchy_distribution<typename Q::rep> {
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct fisher_f_distribution : public std::fisher_f_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::fisher_f_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::fisher_f_distribution<rep>;
|
||||
|
||||
fisher_f_distribution() : base() {}
|
||||
fisher_f_distribution(const rep& m, const rep& n) : base(m, n) {}
|
||||
@@ -390,8 +390,8 @@ struct fisher_f_distribution : public std::fisher_f_distribution<typename Q::rep
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
struct student_t_distribution : public std::student_t_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::student_t_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::student_t_distribution<rep>;
|
||||
|
||||
student_t_distribution() : base() {}
|
||||
explicit student_t_distribution(const rep& n) : base(n) {}
|
||||
@@ -409,8 +409,8 @@ struct student_t_distribution : public std::student_t_distribution<typename Q::r
|
||||
template<Quantity Q>
|
||||
requires std::integral<typename Q::rep>
|
||||
struct discrete_distribution : public std::discrete_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::discrete_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::discrete_distribution<rep>;
|
||||
|
||||
discrete_distribution() : base() {}
|
||||
|
||||
@@ -440,8 +440,8 @@ struct discrete_distribution : public std::discrete_distribution<typename Q::rep
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
class piecewise_constant_distribution : public std::piecewise_constant_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::piecewise_constant_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::piecewise_constant_distribution<rep>;
|
||||
|
||||
template<typename InputIt>
|
||||
piecewise_constant_distribution(const std::vector<rep>& i, InputIt first_w) : base(i.cbegin(), i.cend(), first_w)
|
||||
@@ -498,8 +498,8 @@ public:
|
||||
template<Quantity Q>
|
||||
requires std::floating_point<typename Q::rep>
|
||||
class piecewise_linear_distribution : public std::piecewise_linear_distribution<typename Q::rep> {
|
||||
using rep = TYPENAME Q::rep;
|
||||
using base = TYPENAME std::piecewise_linear_distribution<rep>;
|
||||
using rep = MP_UNITS_TYPENAME Q::rep;
|
||||
using base = MP_UNITS_TYPENAME std::piecewise_linear_distribution<rep>;
|
||||
|
||||
template<typename InputIt>
|
||||
piecewise_linear_distribution(const std::vector<rep>& i, InputIt first_w) : base(i.cbegin(), i.cend(), first_w)
|
||||
|
Reference in New Issue
Block a user