mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
test: derived_quantity
-related compilation error fixed
This commit is contained in:
@@ -245,7 +245,7 @@ struct derived_quantity : quantity<typename Q::dimension, typename Q::unit, Rep>
|
||||
using rep = Rep;
|
||||
using R = quantity<dimension, unit, Rep>;
|
||||
|
||||
constexpr derived_quantity() : R(){};
|
||||
derived_quantity() = default;
|
||||
constexpr explicit(!std::is_trivial_v<Rep>) derived_quantity(const R& t) : R(t) {}
|
||||
constexpr explicit(!std::is_trivial_v<Rep>) derived_quantity(R&& t) : R(std::move(t)) {}
|
||||
|
||||
@@ -259,8 +259,9 @@ struct derived_quantity : quantity<typename Q::dimension, typename Q::unit, Rep>
|
||||
};
|
||||
|
||||
static_assert(detail::is_quantity<derived_quantity<double, si::length<metre>, "NTTP type description">>);
|
||||
constexpr isq::Length auto get_length_derived_quantity() noexcept {
|
||||
derived_quantity<double, si::length<metre>, "NTTP type description"> a;
|
||||
constexpr isq::Length auto get_length_derived_quantity() noexcept
|
||||
{
|
||||
derived_quantity<double, si::length<metre>, "NTTP type description"> a{};
|
||||
a += 1_q_m;
|
||||
a = a + 1_q_m;
|
||||
a *= 0.5;
|
||||
|
Reference in New Issue
Block a user