test: what we mean

a concept can fail for whatever requirement,
and maybe the "main" one actually works
(== in this case)
This commit is contained in:
Johel Ernesto Guerrero Peña
2020-09-05 22:53:19 -04:00
committed by Mateusz Pusz
parent aff83b31dc
commit 4aeb9d305a

View File

@@ -226,12 +226,16 @@ static_assert(quantity_point_cast<int>(quantity_point(1.23q_m)).relative().count
// time
#if COMP_MSVC || COMP_GCC >= 10
static_assert(!std::equality_comparable_with<quantity_point<dim_time, second, int>,
quantity_point<dim_length, metre, int>>); // different dimensions
#endif
static_assert(quantity_point{1q_h} == quantity_point{3600q_s});
template<typename Metre>
constexpr bool no_crossdimensional_equality = !requires
{
quantity_point(1q_s) == quantity_point(length<Metre, int>(1));
};
static_assert(no_crossdimensional_equality<metre>);
// length
static_assert(quantity_point(1q_km) == quantity_point(1000q_m));