From b7b8a0bf936b0601edb50227836cc6affe1abfc4 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 20 Oct 2021 18:52:13 +0200 Subject: [PATCH] fix: CTAD for aliases fixed --- src/core/include/units/quantity.h | 3 +++ test/unit_test/static/quantity_test.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/core/include/units/quantity.h b/src/core/include/units/quantity.h index 3d47d440..a5ebf3ce 100644 --- a/src/core/include/units/quantity.h +++ b/src/core/include/units/quantity.h @@ -383,6 +383,9 @@ public: }; // CTAD +template +explicit(false) quantity(Rep&&) -> quantity; + template explicit(false) quantity(Rep) -> quantity; diff --git a/test/unit_test/static/quantity_test.cpp b/test/unit_test/static/quantity_test.cpp index 12567ba7..d00d03d2 100644 --- a/test/unit_test/static/quantity_test.cpp +++ b/test/unit_test/static/quantity_test.cpp @@ -273,6 +273,9 @@ static_assert(get_length_derived_quantity() == 1_q_m); // CTAD ///////// +static_assert(std::is_same_v); +static_assert(std::is_same_v); + static_assert(is_same_v(123)}), length>); static_assert(is_same_v(123)}), speed>); // static_assert(is_same_v(123)}), length>); // TODO gcc ICE