feat: point_from added to quantity_point
This commit is contained in:
1 parent
0292048252
commit
1328ae4245
1 file changed
+11
@@ -139,6 +139,17 @@ public:
|
||||
quantity_point& operator=(const quantity_point&) = default;
|
||||
quantity_point& operator=(quantity_point&&) = default;
|
||||
|
||||
template<PointOriginFor<quantity_spec> NewPO>
|
||||
[[nodiscard]] constexpr QuantityPointOf<NewPO{}> auto point_from(NewPO origin) const
|
||||
{
|
||||
if constexpr (detail::is_derived_from_specialization_of_relative_point_origin<NewPO>) {
|
||||
auto q = absolute() - origin.parent_origin.absolute();
|
||||
return quantity_point<reference, NewPO{}, typename decltype(q)::rep>(std::move(q));
|
||||
} else {
|
||||
return quantity_point<reference, NewPO{}, Rep>(absolute());
|
||||
}
|
||||
}
|
||||
|
||||
// data access
|
||||
#ifdef __cpp_explicit_this_parameter
|
||||
template<typename Self>
|
||||
|
||||
Reference in new issue
Block a user