Remove troublesome ::ratio members
For some reason, MSVC seems to want to instantiate these, even though nobody ever asks for them (as evidenced by the fact that the builds passed on other architectures).
This commit is contained in:
1 parent
7a03692e14
commit
78bcb3b019
11 files changed
+16
-19
No files matched your search
@@ -72,8 +72,8 @@ struct equivalent_impl<D1, D2> :
|
||||
// additionally accounts for unknown dimensions
|
||||
template<Unit U1, Dimension D1, Unit U2, Dimension D2>
|
||||
struct equivalent_unit :
|
||||
std::disjunction<equivalent_impl<U1, U2>, std::bool_constant<U1::ratio / dimension_unit<D1>::ratio ==
|
||||
U2::ratio / dimension_unit<D2>::ratio>> {};
|
||||
std::disjunction<equivalent_impl<U1, U2>,
|
||||
std::bool_constant<U1::mag / dimension_unit<D1>::mag == U2::mag / dimension_unit<D2>::mag>> {};
|
||||
|
||||
// point origins
|
||||
|
||||
|
||||
@@ -151,14 +151,14 @@ constexpr auto unit_text()
|
||||
// use predefined coherent unit symbol
|
||||
constexpr auto symbol_text = coherent_unit::symbol;
|
||||
constexpr auto prefix_txt =
|
||||
prefix_or_ratio_text<U::ratio / coherent_unit::ratio, typename U::reference::prefix_family,
|
||||
prefix_or_ratio_text<as_ratio(U::mag / coherent_unit::mag), typename U::reference::prefix_family,
|
||||
symbol_text.standard().size()>();
|
||||
return prefix_txt + symbol_text;
|
||||
} else {
|
||||
// use derived dimension ingredients to create a unit symbol
|
||||
constexpr auto symbol_text = derived_dimension_unit_text<Dim>();
|
||||
constexpr auto prefix_txt =
|
||||
prefix_or_ratio_text<U::ratio / coherent_unit::ratio, typename U::reference::prefix_family,
|
||||
prefix_or_ratio_text<as_ratio(U::mag / coherent_unit::mag), typename U::reference::prefix_family,
|
||||
symbol_text.standard().size()>();
|
||||
return prefix_txt + symbol_text;
|
||||
}
|
||||
|
||||
@@ -86,13 +86,13 @@ using to_std_ratio = decltype(detail::to_std_ratio_impl<R>());
|
||||
template<typename U, typename Rep>
|
||||
[[nodiscard]] constexpr auto to_std_duration(const quantity<isq::si::dim_time, U, Rep>& q)
|
||||
{
|
||||
return std::chrono::duration<Rep, to_std_ratio<U::ratio>>(q.number());
|
||||
return std::chrono::duration<Rep, to_std_ratio<as_ratio(U::mag)>>(q.number());
|
||||
}
|
||||
|
||||
template<typename C, typename U, typename Rep>
|
||||
[[nodiscard]] constexpr auto to_std_time_point(const quantity_point<clock_origin<C>, U, Rep>& qp)
|
||||
{
|
||||
using ret_type = std::chrono::time_point<C, std::chrono::duration<Rep, to_std_ratio<U::ratio>>>;
|
||||
using ret_type = std::chrono::time_point<C, std::chrono::duration<Rep, to_std_ratio<as_ratio(U::mag)>>>;
|
||||
return ret_type(to_std_duration(qp.relative()));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace detail {
|
||||
template<PrefixFamily PF, ratio R>
|
||||
struct prefix_base : downcast_base<prefix_base<PF, R>> {
|
||||
using prefix_family = PF;
|
||||
static constexpr ::units::ratio ratio = R;
|
||||
static constexpr Magnitude auto mag = as_magnitude<R>();
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ namespace units {
|
||||
*/
|
||||
template<Magnitude auto M, typename U>
|
||||
struct scaled_unit : downcast_base<scaled_unit<M, U>> {
|
||||
static constexpr ::units::ratio ratio = as_ratio(M);
|
||||
static constexpr Magnitude auto mag = M;
|
||||
using reference = U;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user