fix: CTAD for aliases fixed

This commit is contained in:
Mateusz Pusz
2021-10-20 18:52:13 +02:00
parent 72ef7584a4
commit b7b8a0bf93
2 changed files with 6 additions and 0 deletions

View File

@@ -383,6 +383,9 @@ public:
};
// CTAD
template<typename D, typename U, typename Rep>
explicit(false) quantity(Rep&&) -> quantity<D, U, Rep>;
template<Representation Rep>
explicit(false) quantity(Rep) -> quantity<dim_one, one, Rep>;

View File

@@ -273,6 +273,9 @@ static_assert(get_length_derived_quantity() == 1_q_m);
// CTAD
/////////
static_assert(std::is_same_v<decltype(units::aliases::isq::si::m(123))::rep, int>);
static_assert(std::is_same_v<decltype(units::aliases::isq::si::m(123.))::rep, double>);
static_assert(is_same_v<decltype(quantity{length<metre, int>(123)}), length<metre, int>>);
static_assert(is_same_v<decltype(quantity{speed<metre_per_second>(123)}), speed<metre_per_second>>);
// static_assert(is_same_v<decltype(length{length<metre, int>(123)}), length<metre, int>>); // TODO gcc ICE