feat: support for convertibility of point origins added

This commit is contained in:
Mateusz Pusz committed 2023-05-24 22:39:42 +02:00
1 parent 68b32533a8
commit a3e5c84a47
4 files changed
+11 -5

No files matched your search

@@ -98,7 +98,7 @@ concept QuantityPointOf =
QuantityPoint<QP> &&
(ReferenceOf<std::remove_const_t<decltype(QP::reference)>, V> ||
(PointOrigin<std::remove_const_t<decltype(V)>> &&
std::same_as<std::remove_const_t<decltype(QP::absolute_point_origin)>, std::remove_const_t<decltype(V)>>));
std::convertible_to<std::remove_const_t<decltype(QP::absolute_point_origin)>, std::remove_const_t<decltype(V)>>));
/**
* @brief A concept matching all external quantity point like types
+6 -1
View File
@@ -1,4 +1,3 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
@@ -33,6 +32,12 @@ namespace mp_units {
template<QuantitySpec auto Q>
struct absolute_point_origin {
static constexpr QuantitySpec auto quantity_spec = Q;
absolute_point_origin() = default;
template<QuantitySpec auto Q2>
requires(implicitly_convertible(Q2, Q))
consteval absolute_point_origin(absolute_point_origin<Q2>)
{
}
};
namespace detail {