feat: support for convertibility of point origins added
This commit is contained in:
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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user